From owner-svn-src-stable@freebsd.org Sun Apr 8 14:09:28 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45E4CF84495; Sun, 8 Apr 2018 14:09:28 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EDC667CAEF; Sun, 8 Apr 2018 14:09:27 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E571810DBB; Sun, 8 Apr 2018 14:09:27 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38E9Rg3022461; Sun, 8 Apr 2018 14:09:27 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38E9Rq5022460; Sun, 8 Apr 2018 14:09:27 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804081409.w38E9Rq5022460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 8 Apr 2018 14:09:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332276 - stable/11/sys/netinet/libalias X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet/libalias X-SVN-Commit-Revision: 332276 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 14:09:28 -0000 Author: tuexen Date: Sun Apr 8 14:09:27 2018 New Revision: 332276 URL: https://svnweb.freebsd.org/changeset/base/332276 Log: MFC r327203: Allow the first (and second) argument of sn_calloc() be a sum. This fixes a bug reported in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224103 PR: 224103 Modified: stable/11/sys/netinet/libalias/alias_sctp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/libalias/alias_sctp.c ============================================================================== --- stable/11/sys/netinet/libalias/alias_sctp.c Sun Apr 8 13:40:38 2018 (r332275) +++ stable/11/sys/netinet/libalias/alias_sctp.c Sun Apr 8 14:09:27 2018 (r332276) @@ -185,7 +185,7 @@ static MALLOC_DEFINE(M_SCTPNAT, "sctpnat", "sctp nat d /* Use kernel allocator. */ #ifdef _SYS_MALLOC_H_ #define sn_malloc(x) malloc(x, M_SCTPNAT, M_NOWAIT|M_ZERO) -#define sn_calloc(n,x) sn_malloc(x * n) +#define sn_calloc(n,x) sn_malloc((x) * (n)) #define sn_free(x) free(x, M_SCTPNAT) #endif// #ifdef _SYS_MALLOC_H_ From owner-svn-src-stable@freebsd.org Sun Apr 8 15:30:59 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FBD0F8A461; Sun, 8 Apr 2018 15:30:59 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D52E6A1E2; Sun, 8 Apr 2018 15:30:59 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EDC8911B3A; Sun, 8 Apr 2018 15:30:58 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38FUwLr063222; Sun, 8 Apr 2018 15:30:58 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38FUwmc063221; Sun, 8 Apr 2018 15:30:58 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804081530.w38FUwmc063221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sun, 8 Apr 2018 15:30:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332279 - stable/11/sys/dev/nxge X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/11/sys/dev/nxge X-SVN-Commit-Revision: 332279 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 15:30:59 -0000 Author: brooks Date: Sun Apr 8 15:30:58 2018 New Revision: 332279 URL: https://svnweb.freebsd.org/changeset/base/332279 Log: MFC r331654, r331869 r331654: Don't access userspace directly from the kernel in nxge(4). Update to what the previous code seemed to be doing via the correct interfaces. Further issues exist in xge_ioctl_registers(), but this is debugging code in a driver that has few users and they don't appear to be crashes or leaks. Reviewed by: jhb (prior version) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14848 r331869: Fix the build on arches with default unsigned char. Capture the fubyte() return value in an int as well as the char, and test the full int value for fubyte() failure. Modified: stable/11/sys/dev/nxge/if_nxge.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/nxge/if_nxge.c ============================================================================== --- stable/11/sys/dev/nxge/if_nxge.c Sun Apr 8 15:21:12 2018 (r332278) +++ stable/11/sys/dev/nxge/if_nxge.c Sun Apr 8 15:30:58 2018 (r332279) @@ -1362,11 +1362,16 @@ int xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifreqp) { xge_hal_status_e status = XGE_HAL_OK; - char *data = (char *)ifreqp->ifr_data; + char cmd, mode; void *info = NULL; - int retValue = EINVAL; + int retValue; - switch(*data) { + cmd = retValue = fubyte(ifreqp->ifr_data); + if (retValue == -1) + return (EFAULT); + + retValue = EINVAL; + switch(cmd) { case XGE_QUERY_STATS: mtx_lock(&lldev->mtx_drv); status = xge_hal_stats_hw(lldev->devh, @@ -1494,8 +1499,8 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre case XGE_SET_BUFFER_MODE_1: case XGE_SET_BUFFER_MODE_2: case XGE_SET_BUFFER_MODE_5: - *data = (*data == XGE_SET_BUFFER_MODE_1) ? 'Y':'N'; - if(copyout(data, ifreqp->ifr_data, sizeof(data)) == 0) + mode = (cmd == XGE_SET_BUFFER_MODE_1) ? 'Y':'N'; + if(copyout(&mode, ifreqp->ifr_data, sizeof(mode)) == 0) retValue = 0; break; default: @@ -1516,10 +1521,17 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre int xge_ioctl_registers(xge_lldev_t *lldev, struct ifreq *ifreqp) { - xge_register_t *data = (xge_register_t *)ifreqp->ifr_data; + xge_register_t tmpdata; + xge_register_t *data; xge_hal_status_e status = XGE_HAL_OK; int retValue = EINVAL, offset = 0, index = 0; + int error; u64 val64 = 0; + + error = copyin(ifreqp->ifr_data, &tmpdata, sizeof(tmpdata)); + if (error != 0) + return (error); + data = &tmpdata; /* Reading a register */ if(strcmp(data->option, "-r") == 0) { From owner-svn-src-stable@freebsd.org Sun Apr 8 15:35:58 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 540FCF8AB60; Sun, 8 Apr 2018 15:35:58 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 062AA6CFC9; Sun, 8 Apr 2018 15:35:58 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D931C11CAA; Sun, 8 Apr 2018 15:35:57 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38FZv0M067032; Sun, 8 Apr 2018 15:35:57 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38FZvwg067031; Sun, 8 Apr 2018 15:35:57 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804081535.w38FZvwg067031@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sun, 8 Apr 2018 15:35:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332280 - stable/10/sys/dev/nxge X-SVN-Group: stable-10 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/10/sys/dev/nxge X-SVN-Commit-Revision: 332280 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 15:35:58 -0000 Author: brooks Date: Sun Apr 8 15:35:57 2018 New Revision: 332280 URL: https://svnweb.freebsd.org/changeset/base/332280 Log: MFC r331654, r331869 r331654: Don't access userspace directly from the kernel in nxge(4). Update to what the previous code seemed to be doing via the correct interfaces. Further issues exist in xge_ioctl_registers(), but this is debugging code in a driver that has few users and they don't appear to be crashes or leaks. Reviewed by: jhb (prior version) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14848 r331869: Fix the build on arches with default unsigned char. Capture the fubyte() return value in an int as well as the char, and test the full int value for fubyte() failure. Modified: stable/10/sys/dev/nxge/if_nxge.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/nxge/if_nxge.c ============================================================================== --- stable/10/sys/dev/nxge/if_nxge.c Sun Apr 8 15:30:58 2018 (r332279) +++ stable/10/sys/dev/nxge/if_nxge.c Sun Apr 8 15:35:57 2018 (r332280) @@ -1361,11 +1361,16 @@ int xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifreqp) { xge_hal_status_e status = XGE_HAL_OK; - char *data = (char *)ifreqp->ifr_data; + char cmd, mode; void *info = NULL; - int retValue = EINVAL; + int retValue; - switch(*data) { + cmd = retValue = fubyte(ifreqp->ifr_data); + if (retValue == -1) + return (EFAULT); + + retValue = EINVAL; + switch(cmd) { case XGE_QUERY_STATS: mtx_lock(&lldev->mtx_drv); status = xge_hal_stats_hw(lldev->devh, @@ -1493,8 +1498,8 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre case XGE_SET_BUFFER_MODE_1: case XGE_SET_BUFFER_MODE_2: case XGE_SET_BUFFER_MODE_5: - *data = (*data == XGE_SET_BUFFER_MODE_1) ? 'Y':'N'; - if(copyout(data, ifreqp->ifr_data, sizeof(data)) == 0) + mode = (cmd == XGE_SET_BUFFER_MODE_1) ? 'Y':'N'; + if(copyout(&mode, ifreqp->ifr_data, sizeof(mode)) == 0) retValue = 0; break; default: @@ -1515,10 +1520,17 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre int xge_ioctl_registers(xge_lldev_t *lldev, struct ifreq *ifreqp) { - xge_register_t *data = (xge_register_t *)ifreqp->ifr_data; + xge_register_t tmpdata; + xge_register_t *data; xge_hal_status_e status = XGE_HAL_OK; int retValue = EINVAL, offset = 0, index = 0; + int error; u64 val64 = 0; + + error = copyin(ifreqp->ifr_data, &tmpdata, sizeof(tmpdata)); + if (error != 0) + return (error); + data = &tmpdata; /* Reading a register */ if(strcmp(data->option, "-r") == 0) { From owner-svn-src-stable@freebsd.org Sun Apr 8 15:52:33 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AC23F8BD5B; Sun, 8 Apr 2018 15:52:33 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B85B17643F; Sun, 8 Apr 2018 15:52:32 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B166011FEB; Sun, 8 Apr 2018 15:52:32 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38FqWA6077074; Sun, 8 Apr 2018 15:52:32 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38FqWMj077072; Sun, 8 Apr 2018 15:52:32 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804081552.w38FqWMj077072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sun, 8 Apr 2018 15:52:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332281 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 332281 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 15:52:33 -0000 Author: brooks Date: Sun Apr 8 15:52:32 2018 New Revision: 332281 URL: https://svnweb.freebsd.org/changeset/base/332281 Log: MFC r331641, r331644, r332158 r331641: Fix access to ifru_buffer on freebsd32. Make all kernel accesses to ifru_buffer go via access functions which take the process ABI into account and use an appropriate union to access members in the correct place in struct ifreq. Reviewed by: kib Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14846 r331644: Fix a whitespace bug missed in refactoring prior to r331641. MFC with: r331641 r332158: Remove the thread argument from ifr_buffer_*() accessors. They are always used in a context where curthread is the correct thread. This makes them more similar to the ifr_data_get_ptr() accessor. Modified: stable/11/sys/net/if.c stable/11/sys/net/if.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/if.c ============================================================================== --- stable/11/sys/net/if.c Sun Apr 8 15:35:57 2018 (r332280) +++ stable/11/sys/net/if.c Sun Apr 8 15:52:32 2018 (r332281) @@ -55,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -97,8 +98,50 @@ #ifdef COMPAT_FREEBSD32 #include #include + +struct ifreq_buffer32 { + uint32_t length; /* (size_t) */ + uint32_t buffer; /* (void *) */ +}; + +/* + * Interface request structure used for socket + * ioctl's. All interface ioctl's must have parameter + * definitions which begin with ifr_name. The + * remainder may be interface specific. + */ +struct ifreq32 { + char ifr_name[IFNAMSIZ]; /* if name, e.g. "en0" */ + union { + struct sockaddr ifru_addr; + struct sockaddr ifru_dstaddr; + struct sockaddr ifru_broadaddr; + struct ifreq_buffer32 ifru_buffer; + short ifru_flags[2]; + short ifru_index; + int ifru_jid; + int ifru_metric; + int ifru_mtu; + int ifru_phys; + int ifru_media; + uint32_t ifru_data; + int ifru_cap[2]; + u_int ifru_fib; + u_char ifru_vlan_pcp; + } ifr_ifru; +}; +CTASSERT(sizeof(struct ifreq) == sizeof(struct ifreq32)); +CTASSERT(__offsetof(struct ifreq, ifr_ifru) == + __offsetof(struct ifreq32, ifr_ifru)); #endif +union ifreq_union { + struct ifreq ifr; +#ifdef COMPAT_FREEBSD32 + struct ifreq32 ifr32; +#endif +}; + SYSCTL_NODE(_net, PF_LINK, link, CTLFLAG_RW, 0, "Link layers"); SYSCTL_NODE(_net_link, 0, generic, CTLFLAG_RW, 0, "Generic link-management"); @@ -2302,6 +2345,61 @@ ifunit(const char *name) return (ifp); } +static void * +ifr_buffer_get_buffer(void *data) +{ + union ifreq_union *ifrup; + + ifrup = data; +#ifdef COMPAT_FREEBSD32 + if (SV_CURPROC_FLAG(SV_ILP32)) + return ((void *)(uintptr_t) + ifrup->ifr32.ifr_ifru.ifru_buffer.buffer); +#endif + return (ifrup->ifr.ifr_ifru.ifru_buffer.buffer); +} + +static void +ifr_buffer_set_buffer_null(void *data) +{ + union ifreq_union *ifrup; + + ifrup = data; +#ifdef COMPAT_FREEBSD32 + if (SV_CURPROC_FLAG(SV_ILP32)) + ifrup->ifr32.ifr_ifru.ifru_buffer.buffer = 0; + else +#endif + ifrup->ifr.ifr_ifru.ifru_buffer.buffer = NULL; +} + +static size_t +ifr_buffer_get_length(void *data) +{ + union ifreq_union *ifrup; + + ifrup = data; +#ifdef COMPAT_FREEBSD32 + if (SV_CURPROC_FLAG(SV_ILP32)) + return (ifrup->ifr32.ifr_ifru.ifru_buffer.length); +#endif + return (ifrup->ifr.ifr_ifru.ifru_buffer.length); +} + +static void +ifr_buffer_set_length(void *data, size_t len) +{ + union ifreq_union *ifrup; + + ifrup = data; +#ifdef COMPAT_FREEBSD32 + if (SV_CURPROC_FLAG(SV_ILP32)) + ifrup->ifr32.ifr_ifru.ifru_buffer.length = len; + else +#endif + ifrup->ifr.ifr_ifru.ifru_buffer.length = len; +} + /* * Hardware specific interface ioctls. */ @@ -2362,12 +2460,12 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, else { /* space for terminating nul */ descrlen = strlen(ifp->if_description) + 1; - if (ifr->ifr_buffer.length < descrlen) - ifr->ifr_buffer.buffer = NULL; + if (ifr_buffer_get_length(ifr) < descrlen) + ifr_buffer_set_buffer_null(ifr); else error = copyout(ifp->if_description, - ifr->ifr_buffer.buffer, descrlen); - ifr->ifr_buffer.length = descrlen; + ifr_buffer_get_buffer(ifr), descrlen); + ifr_buffer_set_length(ifr, descrlen); } sx_sunlock(&ifdescr_sx); break; @@ -2383,15 +2481,15 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, * length parameter is supposed to count the * terminating nul in. */ - if (ifr->ifr_buffer.length > ifdescr_maxlen) + if (ifr_buffer_get_length(ifr) > ifdescr_maxlen) return (ENAMETOOLONG); - else if (ifr->ifr_buffer.length == 0) + else if (ifr_buffer_get_length(ifr) == 0) descrbuf = NULL; else { - descrbuf = malloc(ifr->ifr_buffer.length, M_IFDESCR, - M_WAITOK | M_ZERO); - error = copyin(ifr->ifr_buffer.buffer, descrbuf, - ifr->ifr_buffer.length - 1); + descrbuf = malloc(ifr_buffer_get_length(ifr), + M_IFDESCR, M_WAITOK | M_ZERO); + error = copyin(ifr_buffer_get_buffer(ifr), descrbuf, + ifr_buffer_get_length(ifr) - 1); if (error) { free(descrbuf, M_IFDESCR); break; Modified: stable/11/sys/net/if.h ============================================================================== --- stable/11/sys/net/if.h Sun Apr 8 15:35:57 2018 (r332280) +++ stable/11/sys/net/if.h Sun Apr 8 15:52:32 2018 (r332281) @@ -398,7 +398,9 @@ struct ifreq { #define ifr_addr ifr_ifru.ifru_addr /* address */ #define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */ #define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */ +#ifndef _KERNEL #define ifr_buffer ifr_ifru.ifru_buffer /* user supplied buffer with its length */ +#endif #define ifr_flags ifr_ifru.ifru_flags[0] /* flags (low 16 bits) */ #define ifr_flagshigh ifr_ifru.ifru_flags[1] /* flags (high 16 bits) */ #define ifr_jid ifr_ifru.ifru_jid /* jail/vnet */ From owner-svn-src-stable@freebsd.org Sun Apr 8 16:24:38 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 191D0F8E07F; Sun, 8 Apr 2018 16:24:38 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BDF45683C3; Sun, 8 Apr 2018 16:24:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B5A27124F7; Sun, 8 Apr 2018 16:24:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38GObcQ092210; Sun, 8 Apr 2018 16:24:37 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38GOb3r092209; Sun, 8 Apr 2018 16:24:37 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804081624.w38GOb3r092209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 8 Apr 2018 16:24:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332282 - stable/10/sys/netinet/libalias X-SVN-Group: stable-10 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/10/sys/netinet/libalias X-SVN-Commit-Revision: 332282 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 16:24:38 -0000 Author: tuexen Date: Sun Apr 8 16:24:37 2018 New Revision: 332282 URL: https://svnweb.freebsd.org/changeset/base/332282 Log: MFC r327203: Allow the first (and second) argument of sn_calloc() be a sum. This fixes a bug reported in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224103 PR: 224103 Modified: stable/10/sys/netinet/libalias/alias_sctp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/libalias/alias_sctp.c ============================================================================== --- stable/10/sys/netinet/libalias/alias_sctp.c Sun Apr 8 15:52:32 2018 (r332281) +++ stable/10/sys/netinet/libalias/alias_sctp.c Sun Apr 8 16:24:37 2018 (r332282) @@ -185,7 +185,7 @@ static MALLOC_DEFINE(M_SCTPNAT, "sctpnat", "sctp nat d /* Use kernel allocator. */ #ifdef _SYS_MALLOC_H_ #define sn_malloc(x) malloc(x, M_SCTPNAT, M_NOWAIT|M_ZERO) -#define sn_calloc(n,x) sn_malloc(x * n) +#define sn_calloc(n,x) sn_malloc((x) * (n)) #define sn_free(x) free(x, M_SCTPNAT) #endif// #ifdef _SYS_MALLOC_H_ From owner-svn-src-stable@freebsd.org Sun Apr 8 16:26:16 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8A06F8E229; Sun, 8 Apr 2018 16:26:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 868C4692E0; Sun, 8 Apr 2018 16:26:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 81136124FB; Sun, 8 Apr 2018 16:26:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38GQGYl092335; Sun, 8 Apr 2018 16:26:16 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38GQGnp092334; Sun, 8 Apr 2018 16:26:16 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804081626.w38GQGnp092334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 8 Apr 2018 16:26:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332283 - stable/10/sys/netinet/libalias X-SVN-Group: stable-10 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/10/sys/netinet/libalias X-SVN-Commit-Revision: 332283 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 16:26:17 -0000 Author: tuexen Date: Sun Apr 8 16:26:16 2018 New Revision: 332283 URL: https://svnweb.freebsd.org/changeset/base/332283 Log: MFC r327205: Fix an assignment. While there, do some whitespace cleanups. CID: 1008936 Modified: stable/10/sys/netinet/libalias/alias_sctp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/libalias/alias_sctp.c ============================================================================== --- stable/10/sys/netinet/libalias/alias_sctp.c Sun Apr 8 16:24:37 2018 (r332282) +++ stable/10/sys/netinet/libalias/alias_sctp.c Sun Apr 8 16:26:16 2018 (r332283) @@ -2114,31 +2114,31 @@ FindSctpGlobal(struct libalias *la, struct in_addr g_a * @return pointer to association or NULL */ static struct sctp_nat_assoc* -FindSctpLocalT(struct libalias *la, struct in_addr g_addr, uint32_t l_vtag, uint16_t g_port, uint16_t l_port) +FindSctpLocalT(struct libalias *la, struct in_addr g_addr, uint32_t l_vtag, uint16_t g_port, uint16_t l_port) { u_int i; struct sctp_nat_assoc *assoc = NULL, *lastmatch = NULL; struct sctp_GlobalAddress *G_Addr = NULL; int cnt = 0; - + if (l_vtag != 0) { /* an init packet, vtag==0 */ i = SN_TABLE_HASH(l_vtag, g_port, la->sctpNatTableSize); LIST_FOREACH(assoc, &la->sctpTableGlobal[i], list_G) { if ((assoc->g_vtag == l_vtag) && (assoc->g_port == g_port) && (assoc->l_port == l_port)) { if (assoc->num_Gaddr) { LIST_FOREACH(G_Addr, &(assoc->Gaddr), list_Gaddr) { - if(G_Addr->g_addr.s_addr == G_Addr->g_addr.s_addr) - return(assoc); /* full match */ + if (G_Addr->g_addr.s_addr == g_addr.s_addr) + return (assoc); /* full match */ } } else { - if (++cnt > 1) return(NULL); + if (++cnt > 1) return (NULL); lastmatch = assoc; } } } } /* If there is more than one match we do not know which local address to send to */ - return( cnt ? lastmatch : NULL ); + return (cnt ? lastmatch : NULL); } /** @ingroup Hash From owner-svn-src-stable@freebsd.org Sun Apr 8 16:29:25 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5899BF8E513; Sun, 8 Apr 2018 16:29:25 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D2166AF01; Sun, 8 Apr 2018 16:29:25 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 054D212501; Sun, 8 Apr 2018 16:29:25 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38GTOhq092494; Sun, 8 Apr 2018 16:29:24 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38GTOuG092493; Sun, 8 Apr 2018 16:29:24 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804081629.w38GTOuG092493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 8 Apr 2018 16:29:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332284 - stable/10/sys/netinet/libalias X-SVN-Group: stable-10 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/10/sys/netinet/libalias X-SVN-Commit-Revision: 332284 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 16:29:25 -0000 Author: tuexen Date: Sun Apr 8 16:29:24 2018 New Revision: 332284 URL: https://svnweb.freebsd.org/changeset/base/332284 Log: Fix an assignment to force the level to be in the required interval. CID: 1008428 Modified: stable/10/sys/netinet/libalias/alias_sctp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/libalias/alias_sctp.c ============================================================================== --- stable/10/sys/netinet/libalias/alias_sctp.c Sun Apr 8 16:26:16 2018 (r332283) +++ stable/10/sys/netinet/libalias/alias_sctp.c Sun Apr 8 16:29:24 2018 (r332284) @@ -420,9 +420,9 @@ int sysctl_chg_loglevel(SYSCTL_HANDLER_ARGS) error = sysctl_handle_int(oidp, &level, 0, req); if (error) return (error); - sysctl_log_level = (level > SN_LOG_DEBUG_MAX)?(SN_LOG_DEBUG_MAX):(level); - sysctl_log_level = (level < SN_LOG_LOW)?(SN_LOG_LOW):(level); - + level = (level > SN_LOG_DEBUG_MAX)?(SN_LOG_DEBUG_MAX):(level); + level = (level < SN_LOG_LOW)?(SN_LOG_LOW):(level); + sysctl_log_level = level; return (0); } From owner-svn-src-stable@freebsd.org Sun Apr 8 16:54:11 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49706F90100; Sun, 8 Apr 2018 16:54:11 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC481792BB; Sun, 8 Apr 2018 16:54:10 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E4661129EF; Sun, 8 Apr 2018 16:54:10 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38GsAW0007814; Sun, 8 Apr 2018 16:54:10 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38Gs7JY007779; Sun, 8 Apr 2018 16:54:07 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804081654.w38Gs7JY007779@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sun, 8 Apr 2018 16:54:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332288 - in stable/11/sys: dev/an dev/ath dev/cxgbe dev/de dev/en dev/fatm dev/hatm dev/if_ndis dev/iwi dev/ixgbe dev/ixl dev/mlx4/mlx4_en dev/mlx5/mlx5_en dev/mwl dev/nxge dev/oce dev... X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in stable/11/sys: dev/an dev/ath dev/cxgbe dev/de dev/en dev/fatm dev/hatm dev/if_ndis dev/iwi dev/ixgbe dev/ixl dev/mlx4/mlx4_en dev/mlx5/mlx5_en dev/mwl dev/nxge dev/oce dev/patm dev/qlnx/qlnxe dev/... X-SVN-Commit-Revision: 332288 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 16:54:11 -0000 Author: brooks Date: Sun Apr 8 16:54:07 2018 New Revision: 332288 URL: https://svnweb.freebsd.org/changeset/base/332288 Log: MFC r331797: Use an accessor function to access ifr_data. This fixes 32-bit compat (no ioctl command defintions are required as struct ifreq is the same size). Reviewed by: kib Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14900 Modified: stable/11/sys/dev/an/if_an.c stable/11/sys/dev/ath/if_ath_ioctl.c stable/11/sys/dev/cxgbe/t4_main.c stable/11/sys/dev/de/if_de.c stable/11/sys/dev/en/midway.c stable/11/sys/dev/fatm/if_fatm.c stable/11/sys/dev/hatm/if_hatm_ioctl.c stable/11/sys/dev/if_ndis/if_ndis.c stable/11/sys/dev/iwi/if_iwi.c stable/11/sys/dev/ixgbe/if_ix.c stable/11/sys/dev/ixl/ixl_pf_main.c stable/11/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c stable/11/sys/dev/mwl/if_mwl.c stable/11/sys/dev/nxge/if_nxge.c stable/11/sys/dev/oce/oce_if.c stable/11/sys/dev/patm/if_patm_ioctl.c stable/11/sys/dev/qlnx/qlnxe/qlnx_os.c stable/11/sys/dev/sbni/if_sbni.c stable/11/sys/dev/sfxge/sfxge.c stable/11/sys/dev/vxge/vxge.c stable/11/sys/dev/wl/if_wl.c stable/11/sys/net/if.c stable/11/sys/net/if.h stable/11/sys/net/if_gif.c stable/11/sys/net/if_gre.c stable/11/sys/net/if_ipsec.c stable/11/sys/net/if_spppsubr.c stable/11/sys/net/if_var.h stable/11/sys/net/if_vlan.c stable/11/sys/net/iflib.c stable/11/sys/net80211/ieee80211_ioctl.c stable/11/sys/netinet/ip_carp.c stable/11/sys/netpfil/pf/if_pfsync.c stable/11/sys/security/mac/mac_net.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/an/if_an.c ============================================================================== --- stable/11/sys/dev/an/if_an.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/an/if_an.c Sun Apr 8 16:54:07 2018 (r332288) @@ -1932,7 +1932,8 @@ an_ioctl(struct ifnet *ifp, u_long command, caddr_t da error = 0; break; case SIOCGAIRONET: - error = copyin(ifr->ifr_data, &sc->areq, sizeof(sc->areq)); + error = copyin(ifr_data_get_ptr(ifr), &sc->areq, + sizeof(sc->areq)); if (error != 0) break; AN_LOCK(sc); @@ -1961,13 +1962,15 @@ an_ioctl(struct ifnet *ifp, u_long command, caddr_t da break; } AN_UNLOCK(sc); - error = copyout(&sc->areq, ifr->ifr_data, sizeof(sc->areq)); + error = copyout(&sc->areq, ifr_data_get_ptr(ifr), + sizeof(sc->areq)); break; case SIOCSAIRONET: if ((error = priv_check(td, PRIV_DRIVER))) goto out; AN_LOCK(sc); - error = copyin(ifr->ifr_data, &sc->areq, sizeof(sc->areq)); + error = copyin(ifr_data_get_ptr(ifr), &sc->areq, + sizeof(sc->areq)); if (error != 0) break; an_setdef(sc, &sc->areq); @@ -1976,7 +1979,8 @@ an_ioctl(struct ifnet *ifp, u_long command, caddr_t da case SIOCGPRIVATE_0: /* used by Cisco client utility */ if ((error = priv_check(td, PRIV_DRIVER))) goto out; - error = copyin(ifr->ifr_data, &l_ioctl, sizeof(l_ioctl)); + error = copyin(ifr_data_get_ptr(ifr), &l_ioctl, + sizeof(l_ioctl)); if (error) goto out; mode = l_ioctl.command; @@ -1994,13 +1998,15 @@ an_ioctl(struct ifnet *ifp, u_long command, caddr_t da AN_UNLOCK(sc); if (!error) { /* copy out the updated command info */ - error = copyout(&l_ioctl, ifr->ifr_data, sizeof(l_ioctl)); + error = copyout(&l_ioctl, ifr_data_get_ptr(ifr), + sizeof(l_ioctl)); } break; case SIOCGPRIVATE_1: /* used by Cisco client utility */ if ((error = priv_check(td, PRIV_DRIVER))) goto out; - error = copyin(ifr->ifr_data, &l_ioctl, sizeof(l_ioctl)); + error = copyin(ifr_data_get_ptr(ifr), &l_ioctl, + sizeof(l_ioctl)); if (error) goto out; l_ioctl.command = 0; Modified: stable/11/sys/dev/ath/if_ath_ioctl.c ============================================================================== --- stable/11/sys/dev/ath/if_ath_ioctl.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/ath/if_ath_ioctl.c Sun Apr 8 16:54:07 2018 (r332288) @@ -267,12 +267,12 @@ ath_ioctl(struct ieee80211com *ic, u_long cmd, void *d rt->info[sc->sc_txrix].dot11Rate &~ IEEE80211_RATE_BASIC; if (rt->info[sc->sc_txrix].phy & IEEE80211_T_HT) sc->sc_stats.ast_tx_rate |= IEEE80211_RATE_MCS; - return copyout(&sc->sc_stats, - ifr->ifr_data, sizeof (sc->sc_stats)); + return copyout(&sc->sc_stats, ifr_data_get_ptr(ifr), + sizeof (sc->sc_stats)); } case SIOCGATHAGSTATS: - return copyout(&sc->sc_aggr_stats, - ifr->ifr_data, sizeof (sc->sc_aggr_stats)); + return copyout(&sc->sc_aggr_stats, ifr_data_get_ptr(ifr), + sizeof (sc->sc_aggr_stats)); case SIOCZATHSTATS: { int error; Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/cxgbe/t4_main.c Sun Apr 8 16:54:07 2018 (r332288) @@ -1795,7 +1795,7 @@ fail: case SIOCGI2C: { struct ifi2creq i2c; - rc = copyin(ifr->ifr_data, &i2c, sizeof(i2c)); + rc = copyin(ifr_data_get_ptr(ifr), &i2c, sizeof(i2c)); if (rc != 0) break; if (i2c.dev_addr != 0xA0 && i2c.dev_addr != 0xA2) { @@ -1813,7 +1813,7 @@ fail: i2c.offset, i2c.len, &i2c.data[0]); end_synchronized_op(sc, 0); if (rc == 0) - rc = copyout(&i2c, ifr->ifr_data, sizeof(i2c)); + rc = copyout(&i2c, ifr_data_get_ptr(ifr), sizeof(i2c)); break; } Modified: stable/11/sys/dev/de/if_de.c ============================================================================== --- stable/11/sys/dev/de/if_de.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/de/if_de.c Sun Apr 8 16:54:07 2018 (r332288) @@ -4266,7 +4266,7 @@ tulip_ifioctl(struct ifnet * ifp, u_long cmd, caddr_t #ifdef SIOCGADDRROM case SIOCGADDRROM: { - error = copyout(sc->tulip_rombuf, ifr->ifr_data, sizeof(sc->tulip_rombuf)); + error = copyout(sc->tulip_rombuf, ifr_data_get_ptr(ifr), sizeof(sc->tulip_rombuf)); break; } #endif Modified: stable/11/sys/dev/en/midway.c ============================================================================== --- stable/11/sys/dev/en/midway.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/en/midway.c Sun Apr 8 16:54:07 2018 (r332288) @@ -1609,7 +1609,7 @@ en_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) case SIOCATMGVCCS: /* return vcc table */ vtab = atm_getvccs((struct atmio_vcc **)sc->vccs, MID_N_VC, sc->vccs_open, &sc->en_mtx, 1); - error = copyout(vtab, ifr->ifr_data, sizeof(*vtab) + + error = copyout(vtab, ifr_data_get_ptr(ifr), sizeof(*vtab) + vtab->count * sizeof(vtab->vccs[0])); free(vtab, M_DEVBUF); break; Modified: stable/11/sys/dev/fatm/if_fatm.c ============================================================================== --- stable/11/sys/dev/fatm/if_fatm.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/fatm/if_fatm.c Sun Apr 8 16:54:07 2018 (r332288) @@ -2497,7 +2497,7 @@ fatm_ioctl(struct ifnet *ifp, u_long cmd, caddr_t arg) /* return vcc table */ vtab = atm_getvccs((struct atmio_vcc **)sc->vccs, FORE_MAX_VCC + 1, sc->open_vccs, &sc->mtx, 1); - error = copyout(vtab, ifr->ifr_data, sizeof(*vtab) + + error = copyout(vtab, ifr_data_get_ptr(ifr), sizeof(*vtab) + vtab->count * sizeof(vtab->vccs[0])); free(vtab, M_DEVBUF); break; Modified: stable/11/sys/dev/hatm/if_hatm_ioctl.c ============================================================================== --- stable/11/sys/dev/hatm/if_hatm_ioctl.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/hatm/if_hatm_ioctl.c Sun Apr 8 16:54:07 2018 (r332288) @@ -334,7 +334,7 @@ hatm_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data /* return vcc table */ vtab = atm_getvccs((struct atmio_vcc **)sc->vccs, HE_MAX_VCCS, sc->open_vccs, &sc->mtx, 1); - error = copyout(vtab, ifr->ifr_data, sizeof(*vtab) + + error = copyout(vtab, ifr_data_get_ptr(ifr), sizeof(*vtab) + vtab->count * sizeof(vtab->vccs[0])); free(vtab, M_DEVBUF); break; Modified: stable/11/sys/dev/if_ndis/if_ndis.c ============================================================================== --- stable/11/sys/dev/if_ndis/if_ndis.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/if_ndis/if_ndis.c Sun Apr 8 16:54:07 2018 (r332288) @@ -2973,11 +2973,12 @@ ndis_80211ioctl(struct ieee80211com *ic, u_long cmd, v switch (cmd) { case SIOCGDRVSPEC: case SIOCSDRVSPEC: - error = copyin(ifr->ifr_data, &oid, sizeof(oid)); + error = copyin(ifr_data_get_ptr(ifr), &oid, sizeof(oid)); if (error) break; oidbuf = malloc(oid.len, M_TEMP, M_WAITOK | M_ZERO); - error = copyin(ifr->ifr_data + sizeof(oid), oidbuf, oid.len); + error = copyin((caddr_t)ifr_data_get_ptr(ifr) + sizeof(oid), + oidbuf, oid.len); } if (error) { @@ -2999,7 +3000,7 @@ ndis_80211ioctl(struct ieee80211com *ic, u_long cmd, v NDIS_UNLOCK(sc); break; } - error = copyin(ifr->ifr_data, &evt, sizeof(evt)); + error = copyin(ifr_data_get_ptr(ifr), &evt, sizeof(evt)); if (error) { NDIS_UNLOCK(sc); break; @@ -3010,14 +3011,15 @@ ndis_80211ioctl(struct ieee80211com *ic, u_long cmd, v break; } error = copyout(&sc->ndis_evt[sc->ndis_evtcidx], - ifr->ifr_data, sizeof(uint32_t) * 2); + ifr_data_get_ptr(ifr), sizeof(uint32_t) * 2); if (error) { NDIS_UNLOCK(sc); break; } if (sc->ndis_evt[sc->ndis_evtcidx].ne_len) { error = copyout(sc->ndis_evt[sc->ndis_evtcidx].ne_buf, - ifr->ifr_data + (sizeof(uint32_t) * 2), + (caddr_t)ifr_data_get_ptr(ifr) + + (sizeof(uint32_t) * 2), sc->ndis_evt[sc->ndis_evtcidx].ne_len); if (error) { NDIS_UNLOCK(sc); @@ -3039,10 +3041,11 @@ ndis_80211ioctl(struct ieee80211com *ic, u_long cmd, v switch (cmd) { case SIOCGDRVSPEC: case SIOCSDRVSPEC: - error = copyout(&oid, ifr->ifr_data, sizeof(oid)); + error = copyout(&oid, ifr_data_get_ptr(ifr), sizeof(oid)); if (error) break; - error = copyout(oidbuf, ifr->ifr_data + sizeof(oid), oid.len); + error = copyout(oidbuf, + (caddr_t)ifr_data_get_ptr(ifr) + sizeof(oid), oid.len); } free(oidbuf, M_TEMP); Modified: stable/11/sys/dev/iwi/if_iwi.c ============================================================================== --- stable/11/sys/dev/iwi/if_iwi.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/iwi/if_iwi.c Sun Apr 8 16:54:07 2018 (r332288) @@ -2057,7 +2057,7 @@ iwi_ioctl(struct ieee80211com *ic, u_long cmd, void *d switch (cmd) { case SIOCGIWISTATS: /* XXX validate permissions/memory/etc? */ - error = copyout(&sc->sc_linkqual, ifr->ifr_data, + error = copyout(&sc->sc_linkqual, ifr_data_get_ptr(ifr), sizeof(struct iwi_notif_link_quality)); break; case SIOCZIWISTATS: Modified: stable/11/sys/dev/ixgbe/if_ix.c ============================================================================== --- stable/11/sys/dev/ixgbe/if_ix.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/ixgbe/if_ix.c Sun Apr 8 16:54:07 2018 (r332288) @@ -4826,7 +4826,7 @@ ixgbe_ioctl(struct ifnet *ifp, u_long command, caddr_t int i; IOCTL_DEBUGOUT("ioctl: SIOCGI2C (Get I2C Data)"); - error = copyin(ifr->ifr_data, &i2c, sizeof(i2c)); + error = copyin(ifr_data_get_ptr(ifr), &i2c, sizeof(i2c)); if (error != 0) break; if (i2c.dev_addr != 0xA0 && i2c.dev_addr != 0xA2) { @@ -4841,7 +4841,7 @@ ixgbe_ioctl(struct ifnet *ifp, u_long command, caddr_t for (i = 0; i < i2c.len; i++) hw->phy.ops.read_i2c_byte(hw, i2c.offset + i, i2c.dev_addr, &i2c.data[i]); - error = copyout(&i2c, ifr->ifr_data, sizeof(i2c)); + error = copyout(&i2c, ifr_data_get_ptr(ifr), sizeof(i2c)); break; } #endif Modified: stable/11/sys/dev/ixl/ixl_pf_main.c ============================================================================== --- stable/11/sys/dev/ixl/ixl_pf_main.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/ixl/ixl_pf_main.c Sun Apr 8 16:54:07 2018 (r332288) @@ -5173,7 +5173,7 @@ ixl_ioctl(struct ifnet * ifp, u_long command, caddr_t if (!pf->has_i2c) return (ENOTTY); - error = copyin(ifr->ifr_data, &i2c, sizeof(i2c)); + error = copyin(ifr_data_get_ptr(ifr), &i2c, sizeof(i2c)); if (error != 0) break; if (i2c.dev_addr != 0xA0 && i2c.dev_addr != 0xA2) { @@ -5190,7 +5190,7 @@ ixl_ioctl(struct ifnet * ifp, u_long command, caddr_t i2c.dev_addr, &i2c.data[i])) return (EIO); - error = copyout(&i2c, ifr->ifr_data, sizeof(i2c)); + error = copyout(&i2c, ifr_data_get_ptr(ifr), sizeof(i2c)); break; } #endif Modified: stable/11/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c ============================================================================== --- stable/11/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c Sun Apr 8 16:54:07 2018 (r332288) @@ -2058,7 +2058,7 @@ out: case SIOCGI2C: { struct ifi2creq i2c; - error = copyin(ifr->ifr_data, &i2c, sizeof(i2c)); + error = copyin(ifr_data_get_ptr(ifr), &i2c, sizeof(i2c)); if (error) break; if (i2c.len > sizeof(i2c.data)) { @@ -2075,7 +2075,7 @@ out: error = -error; break; } - error = copyout(&i2c, ifr->ifr_data, sizeof(i2c)); + error = copyout(&i2c, ifr_data_get_ptr(ifr), sizeof(i2c)); break; } #endif Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Sun Apr 8 16:54:07 2018 (r332288) @@ -2769,7 +2769,7 @@ out: * Copy from the user-space address ifr_data to the * kernel-space address i2c */ - error = copyin(ifr->ifr_data, &i2c, sizeof(i2c)); + error = copyin(ifr_data_get_ptr(ifr), &i2c, sizeof(i2c)); if (error) break; @@ -2833,7 +2833,7 @@ out: goto err_i2c; } - error = copyout(&i2c, ifr->ifr_data, sizeof(i2c)); + error = copyout(&i2c, ifr_data_get_ptr(ifr), sizeof(i2c)); err_i2c: PRIV_UNLOCK(priv); break; Modified: stable/11/sys/dev/mwl/if_mwl.c ============================================================================== --- stable/11/sys/dev/mwl/if_mwl.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/mwl/if_mwl.c Sun Apr 8 16:54:07 2018 (r332288) @@ -4744,8 +4744,8 @@ mwl_ioctl(struct ieee80211com *ic, u_long cmd, void *d * statistics. The alternative is to copy the data * to a local structure. */ - return (copyout(&sc->sc_stats, - ifr->ifr_data, sizeof (sc->sc_stats))); + return (copyout(&sc->sc_stats, ifr_data_get_ptr(ifr), + sizeof (sc->sc_stats))); #ifdef MWL_DIAGAPI case SIOCGMVDIAG: /* XXX check privs */ Modified: stable/11/sys/dev/nxge/if_nxge.c ============================================================================== --- stable/11/sys/dev/nxge/if_nxge.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/nxge/if_nxge.c Sun Apr 8 16:54:07 2018 (r332288) @@ -1366,7 +1366,7 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre void *info = NULL; int retValue; - cmd = retValue = fubyte(ifreqp->ifr_data); + cmd = retValue = fubyte(ifr_data_get_ptr(ifreqp)); if (retValue == -1) return (EFAULT); @@ -1378,7 +1378,7 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre (xge_hal_stats_hw_info_t **)&info); mtx_unlock(&lldev->mtx_drv); if(status == XGE_HAL_OK) { - if(copyout(info, ifreqp->ifr_data, + if(copyout(info, ifr_data_get_ptr(ifreqp), sizeof(xge_hal_stats_hw_info_t)) == 0) retValue = 0; } @@ -1396,7 +1396,7 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre sizeof(xge_hal_pci_config_t)); mtx_unlock(&lldev->mtx_drv); if(status == XGE_HAL_OK) { - if(copyout(info, ifreqp->ifr_data, + if(copyout(info, ifr_data_get_ptr(ifreqp), sizeof(xge_hal_pci_config_t)) == 0) retValue = 0; } @@ -1416,7 +1416,7 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre sizeof(xge_hal_stats_device_info_t)); mtx_unlock(&lldev->mtx_drv); if(status == XGE_HAL_OK) { - if(copyout(info, ifreqp->ifr_data, + if(copyout(info, ifr_data_get_ptr(ifreqp), sizeof(xge_hal_stats_device_info_t)) == 0) retValue = 0; } @@ -1437,7 +1437,7 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre sizeof(xge_hal_stats_sw_err_t)); mtx_unlock(&lldev->mtx_drv); if(status == XGE_HAL_OK) { - if(copyout(info, ifreqp->ifr_data, + if(copyout(info, ifr_data_get_ptr(ifreqp), sizeof(xge_hal_stats_sw_err_t)) == 0) retValue = 0; } @@ -1450,7 +1450,7 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre break; case XGE_QUERY_DRIVERSTATS: - if(copyout(&lldev->driver_stats, ifreqp->ifr_data, + if(copyout(&lldev->driver_stats, ifr_data_get_ptr(ifreqp), sizeof(xge_driver_stats_t)) == 0) { retValue = 0; } @@ -1464,7 +1464,8 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre info = xge_os_malloc(NULL, XGE_BUFFER_SIZE); if(info != NULL) { strcpy(info, XGE_DRIVER_VERSION); - if(copyout(info, ifreqp->ifr_data, XGE_BUFFER_SIZE) == 0) + if(copyout(info, ifr_data_get_ptr(ifreqp), + XGE_BUFFER_SIZE) == 0) retValue = 0; xge_os_free(NULL, info, XGE_BUFFER_SIZE); } @@ -1478,7 +1479,7 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre sizeof(xge_hal_device_config_t)); mtx_unlock(&lldev->mtx_drv); if(status == XGE_HAL_OK) { - if(copyout(info, ifreqp->ifr_data, + if(copyout(info, ifr_data_get_ptr(ifreqp), sizeof(xge_hal_device_config_t)) == 0) retValue = 0; } @@ -1491,7 +1492,7 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre break; case XGE_QUERY_BUFFER_MODE: - if(copyout(&lldev->buffer_mode, ifreqp->ifr_data, + if(copyout(&lldev->buffer_mode, ifr_data_get_ptr(ifreqp), sizeof(int)) == 0) retValue = 0; break; @@ -1500,7 +1501,7 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre case XGE_SET_BUFFER_MODE_2: case XGE_SET_BUFFER_MODE_5: mode = (cmd == XGE_SET_BUFFER_MODE_1) ? 'Y':'N'; - if(copyout(&mode, ifreqp->ifr_data, sizeof(mode)) == 0) + if(copyout(&mode, ifr_data_get_ptr(ifreqp), sizeof(mode)) == 0) retValue = 0; break; default: @@ -1528,7 +1529,7 @@ xge_ioctl_registers(xge_lldev_t *lldev, struct ifreq * int error; u64 val64 = 0; - error = copyin(ifreqp->ifr_data, &tmpdata, sizeof(tmpdata)); + error = copyin(ifr_data_get_ptr(ifreqp), &tmpdata, sizeof(tmpdata)); if (error != 0) return (error); data = &tmpdata; @@ -1541,7 +1542,8 @@ xge_ioctl_registers(xge_lldev_t *lldev, struct ifreq * &data->value); mtx_unlock(&lldev->mtx_drv); if(status == XGE_HAL_OK) { - if(copyout(data, ifreqp->ifr_data, sizeof(xge_register_t)) == 0) + if(copyout(data, ifr_data_get_ptr(ifreqp), + sizeof(xge_register_t)) == 0) retValue = 0; } } @@ -1586,7 +1588,7 @@ xge_ioctl_registers(xge_lldev_t *lldev, struct ifreq * mtx_unlock(&lldev->mtx_drv); if(retValue == 0) { - if(copyout(data, ifreqp->ifr_data, + if(copyout(data, ifr_data_get_ptr(ifreqp), sizeof(xge_hal_pci_bar0_t)) != 0) { xge_trace(XGE_ERR, "Copyout of register values failed"); retValue = EINVAL; Modified: stable/11/sys/dev/oce/oce_if.c ============================================================================== --- stable/11/sys/dev/oce/oce_if.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/oce/oce_if.c Sun Apr 8 16:54:07 2018 (r332288) @@ -1832,7 +1832,7 @@ oce_handle_passthrough(struct ifnet *ifp, caddr_t data struct ifreq *ifr = (struct ifreq *)data; int rc = ENXIO; char cookie[32] = {0}; - void *priv_data = (void *)ifr->ifr_data; + void *priv_data = ifr_data_get_ptr(ifr); void *ioctl_ptr; uint32_t req_size; struct mbx_hdr req; Modified: stable/11/sys/dev/patm/if_patm_ioctl.c ============================================================================== --- stable/11/sys/dev/patm/if_patm_ioctl.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/patm/if_patm_ioctl.c Sun Apr 8 16:54:07 2018 (r332288) @@ -387,7 +387,7 @@ patm_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data /* return vcc table */ vtab = atm_getvccs((struct atmio_vcc **)sc->vccs, sc->mmap->max_conn, sc->vccs_open, &sc->mtx, 1); - error = copyout(vtab, ifr->ifr_data, sizeof(*vtab) + + error = copyout(vtab, ifr_data_get_ptr(ifr), sizeof(*vtab) + vtab->count * sizeof(vtab->vccs[0])); free(vtab, M_DEVBUF); break; Modified: stable/11/sys/dev/qlnx/qlnxe/qlnx_os.c ============================================================================== --- stable/11/sys/dev/qlnx/qlnxe/qlnx_os.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/qlnx/qlnxe/qlnx_os.c Sun Apr 8 16:54:07 2018 (r332288) @@ -2464,7 +2464,7 @@ qlnx_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data struct ecore_hwfn *p_hwfn = &ha->cdev.hwfns[0]; struct ecore_ptt *p_ptt; - ret = copyin(ifr->ifr_data, &i2c, sizeof(i2c)); + ret = copyin(ifr_data_get_ptr(ifr), &i2c, sizeof(i2c)); if (ret) break; @@ -2494,7 +2494,7 @@ qlnx_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data break; } - ret = copyout(&i2c, ifr->ifr_data, sizeof(i2c)); + ret = copyout(&i2c, ifr_data_get_ptr(ifr), sizeof(i2c)); QL_DPRINT8(ha, "SIOCGI2C copyout ret = %d \ len = %d addr = 0x%02x offset = 0x%04x \ Modified: stable/11/sys/dev/sbni/if_sbni.c ============================================================================== --- stable/11/sys/dev/sbni/if_sbni.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/sbni/if_sbni.c Sun Apr 8 16:54:07 2018 (r332288) @@ -1153,7 +1153,7 @@ sbni_ioctl(struct ifnet *ifp, u_long command, caddr_t SBNI_LOCK(sc); bcopy(&sc->in_stats, in_stats, sizeof(struct sbni_in_stats)); SBNI_UNLOCK(sc); - error = copyout(ifr->ifr_data, in_stats, + error = copyout(ifr_data_get_ptr(ifr), in_stats, sizeof(struct sbni_in_stats)); free(in_stats, M_DEVBUF); break; Modified: stable/11/sys/dev/sfxge/sfxge.c ============================================================================== --- stable/11/sys/dev/sfxge/sfxge.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/sfxge/sfxge.c Sun Apr 8 16:54:07 2018 (r332288) @@ -527,7 +527,7 @@ sfxge_if_ioctl(struct ifnet *ifp, unsigned long comman { struct ifi2creq i2c; - error = copyin(ifr->ifr_data, &i2c, sizeof(i2c)); + error = copyin(ifr_data_get_ptr(ifr), &i2c, sizeof(i2c)); if (error != 0) break; @@ -542,7 +542,8 @@ sfxge_if_ioctl(struct ifnet *ifp, unsigned long comman &i2c.data[0]); SFXGE_ADAPTER_UNLOCK(sc); if (error == 0) - error = copyout(&i2c, ifr->ifr_data, sizeof(i2c)); + error = copyout(&i2c, ifr_data_get_ptr(ifr), + sizeof(i2c)); break; } #endif @@ -550,12 +551,13 @@ sfxge_if_ioctl(struct ifnet *ifp, unsigned long comman error = priv_check(curthread, PRIV_DRIVER); if (error != 0) break; - error = copyin(ifr->ifr_data, &ioc, sizeof(ioc)); + error = copyin(ifr_data_get_ptr(ifr), &ioc, sizeof(ioc)); if (error != 0) return (error); error = sfxge_private_ioctl(sc, &ioc); if (error == 0) { - error = copyout(&ioc, ifr->ifr_data, sizeof(ioc)); + error = copyout(&ioc, ifr_data_get_ptr(ifr), + sizeof(ioc)); } break; default: Modified: stable/11/sys/dev/vxge/vxge.c ============================================================================== --- stable/11/sys/dev/vxge/vxge.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/vxge/vxge.c Sun Apr 8 16:54:07 2018 (r332288) @@ -3708,8 +3708,8 @@ vxge_ioctl_regs(vxge_dev_t *vdev, struct ifreq *ifr) u32 offset, reqd_size = 0; int i, err = EINVAL; - char *command = (char *) ifr->ifr_data; - void *reg_info = (void *) ifr->ifr_data; + char *command = ifr_data_get_ptr(ifr); + void *reg_info = ifr_data_get_ptr(ifr); vxge_vpath_t *vpath; vxge_hal_status_e status = VXGE_HAL_OK; @@ -3816,7 +3816,7 @@ vxge_ioctl_stats(vxge_dev_t *vdev, struct ifreq *ifr) vxge_drv_stats_t *drv_stat; char *buffer = NULL; - char *command = (char *) ifr->ifr_data; + char *command = ifr_data_get_ptr(ifr); vxge_hal_status_e status = VXGE_HAL_OK; switch (*command) { @@ -3827,7 +3827,8 @@ vxge_ioctl_stats(vxge_dev_t *vdev, struct ifreq *ifr) status = vxge_hal_aux_pci_config_read(vdev->devh, bufsize, buffer, &retsize); if (status == VXGE_HAL_OK) - err = copyout(buffer, ifr->ifr_data, retsize); + err = copyout(buffer, ifr_data_get_ptr(ifr), + retsize); else device_printf(vdev->ndev, "failed pciconfig statistics query\n"); @@ -3846,7 +3847,8 @@ vxge_ioctl_stats(vxge_dev_t *vdev, struct ifreq *ifr) status = vxge_hal_aux_stats_mrpcim_read(vdev->devh, bufsize, buffer, &retsize); if (status == VXGE_HAL_OK) - err = copyout(buffer, ifr->ifr_data, retsize); + err = copyout(buffer, ifr_data_get_ptr(ifr), + retsize); else device_printf(vdev->ndev, "failed mrpcim statistics query\n"); @@ -3862,7 +3864,8 @@ vxge_ioctl_stats(vxge_dev_t *vdev, struct ifreq *ifr) status = vxge_hal_aux_stats_device_read(vdev->devh, bufsize, buffer, &retsize); if (status == VXGE_HAL_OK) - err = copyout(buffer, ifr->ifr_data, retsize); + err = copyout(buffer, ifr_data_get_ptr(ifr), + retsize); else device_printf(vdev->ndev, "failed device statistics query\n"); @@ -3886,7 +3889,7 @@ vxge_ioctl_stats(vxge_dev_t *vdev, struct ifreq *ifr) ((vxge_device_hw_info_t *) buffer)->port_failure = vdev->port_failure; - err = copyout(buffer, ifr->ifr_data, bufsize); + err = copyout(buffer, ifr_data_get_ptr(ifr), bufsize); if (err != 0) device_printf(vdev->ndev, "failed device hardware info query\n"); @@ -3913,7 +3916,7 @@ vxge_ioctl_stats(vxge_dev_t *vdev, struct ifreq *ifr) sizeof(vxge_drv_stats_t)); } - err = copyout(drv_stat, ifr->ifr_data, bufsize); + err = copyout(drv_stat, ifr_data_get_ptr(ifr), bufsize); if (err != 0) device_printf(vdev->ndev, "failed driver statistics query\n"); @@ -3923,7 +3926,7 @@ vxge_ioctl_stats(vxge_dev_t *vdev, struct ifreq *ifr) break; case VXGE_GET_BANDWIDTH: - bw_info = (vxge_bw_info_t *) ifr->ifr_data; + bw_info = ifr_data_get_ptr(ifr); if ((vdev->config.hw_info.func_id != 0) && (vdev->hw_fw_version < VXGE_FW_VERSION(1, 8, 0))) @@ -3936,7 +3939,8 @@ vxge_ioctl_stats(vxge_dev_t *vdev, struct ifreq *ifr) if (status != VXGE_HAL_OK) break; - err = copyout(bw_info, ifr->ifr_data, sizeof(vxge_bw_info_t)); + err = copyout(bw_info, ifr_data_get_ptr(ifr), + sizeof(vxge_bw_info_t)); break; case VXGE_SET_BANDWIDTH: @@ -3947,7 +3951,7 @@ vxge_ioctl_stats(vxge_dev_t *vdev, struct ifreq *ifr) case VXGE_SET_PORT_MODE: if (vdev->is_privilaged) { if (vdev->config.hw_info.ports == VXGE_DUAL_PORT_MODE) { - port_info = (vxge_port_info_t *) ifr->ifr_data; + port_info = ifr_data_get_ptr(ifr); vdev->config.port_mode = port_info->port_mode; err = vxge_port_mode_update(vdev); if (err != ENXIO) @@ -3964,10 +3968,11 @@ vxge_ioctl_stats(vxge_dev_t *vdev, struct ifreq *ifr) case VXGE_GET_PORT_MODE: if (vdev->is_privilaged) { if (vdev->config.hw_info.ports == VXGE_DUAL_PORT_MODE) { - port_info = (vxge_port_info_t *) ifr->ifr_data; + port_info = ifr_data_get_ptr(ifr); err = vxge_port_mode_get(vdev, port_info); if (err == VXGE_HAL_OK) { - err = copyout(port_info, ifr->ifr_data, + err = copyout(port_info, + ifr_data_get_ptr(ifr), sizeof(vxge_port_info_t)); } } @@ -4003,7 +4008,7 @@ vxge_bw_priority_set(vxge_dev_t *vdev, struct ifreq *i u32 func_id; vxge_bw_info_t *bw_info; - bw_info = (vxge_bw_info_t *) ifr->ifr_data; + bw_info = ifr_data_get_ptr(ifr); func_id = bw_info->func_id; vdev->config.bw_info[func_id].priority = bw_info->priority; Modified: stable/11/sys/dev/wl/if_wl.c ============================================================================== --- stable/11/sys/dev/wl/if_wl.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/wl/if_wl.c Sun Apr 8 16:54:07 2018 (r332288) @@ -1313,7 +1313,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } WL_UNLOCK(sc); - error = copyout(psa_buf, ifr->ifr_data, sizeof(psa_buf)); + error = copyout(psa_buf, ifr_data_get_ptr(ifr), sizeof(psa_buf)); break; @@ -1323,7 +1323,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data) if ((error = priv_check(td, PRIV_DRIVER))) break; - error = copyin(ifr->ifr_data, psa_buf, sizeof(psa_buf)); + error = copyin(ifr_data_get_ptr(ifr), psa_buf, sizeof(psa_buf)); if (error) break; @@ -1357,7 +1357,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data) /* get the current NWID out of the sc since we stored it there */ case SIOCGWLCNWID: WL_LOCK(sc); - ifr->ifr_data = (caddr_t) (sc->nwid[0] << 8 | sc->nwid[1]); + ifr_data_get_ptr(ifr) = (caddr_t) (sc->nwid[0] << 8 | sc->nwid[1]); WL_UNLOCK(sc); break; @@ -1382,8 +1382,8 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data) /* * soft c nwid shadows radio modem setting */ - sc->nwid[0] = (int)ifr->ifr_data >> 8; - sc->nwid[1] = (int)ifr->ifr_data & 0xff; + sc->nwid[0] = (int)ifr_data_get_ptr(ifr) >> 8; + sc->nwid[1] = (int)ifr_data_get_ptr(ifr) & 0xff; MMC_WRITE(MMC_NETW_ID_L,sc->nwid[1]); MMC_WRITE(MMC_NETW_ID_H,sc->nwid[0]); } @@ -1409,7 +1409,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data) wlmmcread(sc, MMC_EEDATALrv); /* 2.4 Gz: EEPROM word */ } WL_UNLOCK(sc); - error = copyout(ifr->ifr_data, eeprom_buf, sizeof(eeprom_buf)); + error = copyout(ifr_data_get_ptr(ifr), eeprom_buf, sizeof(eeprom_buf)); break; #ifdef WLCACHE @@ -1426,7 +1426,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data) /* read out the number of used cache elements */ case SIOCGWLCITEM: WL_LOCK(sc); - ifr->ifr_data = (caddr_t) sc->w_sigitems; + ifr_data_get_ptr(ifr) = (caddr_t) sc->w_sigitems; WL_UNLOCK(sc); break; @@ -1443,7 +1443,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data) bcopy(sc->w_sigcache, cpt, size); WL_UNLOCK(sc); - error = copyout(cpt, ifr->ifr_data, size); + error = copyout(cpt, ifr_data_get_ptr(ifr), size); free(cpt, M_DEVBUF); break; #endif Modified: stable/11/sys/net/if.c ============================================================================== --- stable/11/sys/net/if.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/net/if.c Sun Apr 8 16:54:07 2018 (r332288) @@ -2400,6 +2400,20 @@ ifr_buffer_set_length(void *data, size_t len) ifrup->ifr.ifr_ifru.ifru_buffer.length = len; } +void * +ifr_data_get_ptr(void *ifrp) +{ + union ifreq_union *ifrup; + + ifrup = ifrp; +#ifdef COMPAT_FREEBSD32 + if (SV_CURPROC_FLAG(SV_ILP32)) + return ((void *)(uintptr_t) + ifrup->ifr32.ifr_ifru.ifru_data); +#endif + return (ifrup->ifr.ifr_ifru.ifru_data); +} + /* * Hardware specific interface ioctls. */ @@ -2581,7 +2595,8 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, error = priv_check(td, PRIV_NET_SETIFNAME); if (error) return (error); - error = copyinstr(ifr->ifr_data, new_name, IFNAMSIZ, NULL); + error = copyinstr(ifr_data_get_ptr(ifr), new_name, IFNAMSIZ, + NULL); if (error != 0) return (error); if (new_name[0] == '\0') @@ -2896,8 +2911,8 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, s error = priv_check(td, PRIV_NET_IFCREATE); if (error == 0) error = if_clone_create(ifr->ifr_name, - sizeof(ifr->ifr_name), - cmd == SIOCIFCREATE2 ? ifr->ifr_data : NULL); + sizeof(ifr->ifr_name), cmd == SIOCIFCREATE2 ? + ifr_data_get_ptr(ifr) : NULL); CURVNET_RESTORE(); return (error); case SIOCIFDESTROY: Modified: stable/11/sys/net/if.h ============================================================================== --- stable/11/sys/net/if.h Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/net/if.h Sun Apr 8 16:54:07 2018 (r332288) @@ -408,7 +408,9 @@ struct ifreq { #define ifr_mtu ifr_ifru.ifru_mtu /* mtu */ #define ifr_phys ifr_ifru.ifru_phys /* physical wire */ #define ifr_media ifr_ifru.ifru_media /* physical media */ +#ifndef _KERNEL #define ifr_data ifr_ifru.ifru_data /* for use by interface */ +#endif #define ifr_reqcap ifr_ifru.ifru_cap[0] /* requested capabilities */ #define ifr_curcap ifr_ifru.ifru_cap[1] /* current capabilities */ #define ifr_index ifr_ifru.ifru_index /* interface index */ Modified: stable/11/sys/net/if_gif.c ============================================================================== --- stable/11/sys/net/if_gif.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/net/if_gif.c Sun Apr 8 16:54:07 2018 (r332288) @@ -906,12 +906,14 @@ gif_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; case GIFGOPTS: options = sc->gif_options; - error = copyout(&options, ifr->ifr_data, sizeof(options)); + error = copyout(&options, ifr_data_get_ptr(ifr), + sizeof(options)); break; case GIFSOPTS: if ((error = priv_check(curthread, PRIV_NET_GIF)) != 0) break; - error = copyin(ifr->ifr_data, &options, sizeof(options)); + error = copyin(ifr_data_get_ptr(ifr), &options, + sizeof(options)); if (error) break; if (options & ~GIF_OPTMASK) Modified: stable/11/sys/net/if_gre.c ============================================================================== --- stable/11/sys/net/if_gre.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/net/if_gre.c Sun Apr 8 16:54:07 2018 (r332288) @@ -453,7 +453,8 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) case GRESKEY: if ((error = priv_check(curthread, PRIV_NET_GRE)) != 0) break; - if ((error = copyin(ifr->ifr_data, &opt, sizeof(opt))) != 0) + if ((error = copyin(ifr_data_get_ptr(ifr), &opt, + sizeof(opt))) != 0) break; if (sc->gre_key != opt) { GRE_WLOCK(sc); @@ -463,13 +464,14 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } break; case GREGKEY: - error = copyout(&sc->gre_key, ifr->ifr_data, + error = copyout(&sc->gre_key, ifr_data_get_ptr(ifr), sizeof(sc->gre_key)); break; case GRESOPTS: if ((error = priv_check(curthread, PRIV_NET_GRE)) != 0) break; - if ((error = copyin(ifr->ifr_data, &opt, sizeof(opt))) != 0) + if ((error = copyin(ifr_data_get_ptr(ifr), &opt, + sizeof(opt))) != 0) break; if (opt & ~GRE_OPTMASK) error = EINVAL; @@ -484,7 +486,7 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; case GREGOPTS: - error = copyout(&sc->gre_options, ifr->ifr_data, + error = copyout(&sc->gre_options, ifr_data_get_ptr(ifr), sizeof(sc->gre_options)); break; default: Modified: stable/11/sys/net/if_ipsec.c ============================================================================== --- stable/11/sys/net/if_ipsec.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/net/if_ipsec.c Sun Apr 8 16:54:07 2018 (r332288) @@ -688,12 +688,12 @@ ipsec_ioctl(struct ifnet *ifp, u_long cmd, caddr_t dat break; case IPSECGREQID: reqid = sc->reqid; - error = copyout(&reqid, ifr->ifr_data, sizeof(reqid)); + error = copyout(&reqid, ifr_data_get_ptr(ifr), sizeof(reqid)); break; case IPSECSREQID: if ((error = priv_check(curthread, PRIV_NET_SETIFCAP)) != 0) break; - error = copyin(ifr->ifr_data, &reqid, sizeof(reqid)); + error = copyin(ifr_data_get_ptr(ifr), &reqid, sizeof(reqid)); if (error != 0) break; error = ipsec_set_reqid(ifp, reqid); Modified: stable/11/sys/net/if_spppsubr.c ============================================================================== --- stable/11/sys/net/if_spppsubr.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/net/if_spppsubr.c Sun Apr 8 16:54:07 2018 (r332288) @@ -5058,17 +5058,17 @@ sppp_params(struct sppp *sp, u_long cmd, void *data) if ((spr = malloc(sizeof(struct spppreq), M_TEMP, M_NOWAIT)) == NULL) return (EAGAIN); /* - * ifr->ifr_data is supposed to point to a struct spppreq. + * ifr_data_get_ptr(ifr) is supposed to point to a struct spppreq. * Check the cmd word first before attempting to fetch all the * data. */ - rv = fueword(ifr->ifr_data, &subcmd); + rv = fueword(ifr_data_get_ptr(ifr), &subcmd); if (rv == -1) { rv = EFAULT; goto quit; } - if (copyin((caddr_t)ifr->ifr_data, spr, sizeof(struct spppreq)) != 0) { + if (copyin(ifr_data_get_ptr(ifr), spr, sizeof(struct spppreq)) != 0) { rv = EFAULT; goto quit; } @@ -5105,8 +5105,8 @@ sppp_params(struct sppp *sp, u_long cmd, void *data) * setting it. */ spr->defs.lcp.timeout = sp->lcp.timeout * 1000 / hz; - rv = copyout(spr, (caddr_t)ifr->ifr_data, - sizeof(struct spppreq)); + rv = copyout(spr, ifr_data_get_ptr(ifr), + sizeof(struct spppreq)); break; case (u_long)SPPPIOSDEFS: Modified: stable/11/sys/net/if_var.h ============================================================================== --- stable/11/sys/net/if_var.h Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/net/if_var.h Sun Apr 8 16:54:07 2018 (r332288) @@ -658,6 +658,9 @@ int drbr_enqueue_drv(if_t ifp, struct buf_ring *br, st void if_hw_tsomax_common(if_t ifp, struct ifnet_hw_tsomax *); int if_hw_tsomax_update(if_t ifp, struct ifnet_hw_tsomax *); +/* accessors for struct ifreq */ +void *ifr_data_get_ptr(void *ifrp); + #ifdef DEVICE_POLLING enum poll_cmd { POLL_ONLY, POLL_AND_CHECK_STATUS }; Modified: stable/11/sys/net/if_vlan.c ============================================================================== --- stable/11/sys/net/if_vlan.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/net/if_vlan.c Sun Apr 8 16:54:07 2018 (r332288) @@ -1909,7 +1909,7 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data break; } #endif - error = copyin(ifr->ifr_data, &vlr, sizeof(vlr)); + error = copyin(ifr_data_get_ptr(ifr), &vlr, sizeof(vlr)); if (error) break; if (vlr.vlr_parent[0] == '\0') { @@ -1940,7 +1940,7 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data vlr.vlr_tag = ifv->ifv_vid; } VLAN_SUNLOCK(); - error = copyout(&vlr, ifr->ifr_data, sizeof(vlr)); + error = copyout(&vlr, ifr_data_get_ptr(ifr), sizeof(vlr)); break; case SIOCSIFFLAGS: Modified: stable/11/sys/net/iflib.c ============================================================================== --- stable/11/sys/net/iflib.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/net/iflib.c Sun Apr 8 16:54:07 2018 (r332288) @@ -3260,7 +3260,7 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) { struct ifi2creq i2c; - err = copyin(ifr->ifr_data, &i2c, sizeof(i2c)); + err = copyin(ifr_data_get_ptr(ifr), &i2c, sizeof(i2c)); if (err != 0) break; if (i2c.dev_addr != 0xA0 && i2c.dev_addr != 0xA2) { @@ -3273,7 +3273,8 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) } if ((err = IFDI_I2C_REQ(ctx, &i2c)) == 0) - err = copyout(&i2c, ifr->ifr_data, sizeof(i2c)); + err = copyout(&i2c, ifr_data_get_ptr(ifr), + sizeof(i2c)); break; } case SIOCSIFCAP: Modified: stable/11/sys/net80211/ieee80211_ioctl.c ============================================================================== --- stable/11/sys/net80211/ieee80211_ioctl.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/net80211/ieee80211_ioctl.c Sun Apr 8 16:54:07 2018 (r332288) @@ -3424,7 +3424,8 @@ ieee80211_ioctl(struct ifnet *ifp, u_long cmd, caddr_t break; case SIOCG80211STATS: ifr = (struct ifreq *)data; - copyout(&vap->iv_stats, ifr->ifr_data, sizeof (vap->iv_stats)); + copyout(&vap->iv_stats, ifr_data_get_ptr(ifr), + sizeof (vap->iv_stats)); break; case SIOCSIFMTU: ifr = (struct ifreq *)data; Modified: stable/11/sys/netinet/ip_carp.c ============================================================================== --- stable/11/sys/netinet/ip_carp.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/netinet/ip_carp.c Sun Apr 8 16:54:07 2018 (r332288) @@ -1624,7 +1624,7 @@ carp_ioctl(struct ifreq *ifr, u_long cmd, struct threa struct carp_softc *sc = NULL; int error = 0, locked = 0; - if ((error = copyin(ifr->ifr_data, &carpr, sizeof carpr))) + if ((error = copyin(ifr_data_get_ptr(ifr), &carpr, sizeof carpr))) return (error); ifp = ifunit_ref(ifr->ifr_name); @@ -1741,7 +1741,8 @@ carp_ioctl(struct ifreq *ifr, u_long cmd, struct threa break; } carp_carprcp(&carpr, sc, priveleged); - error = copyout(&carpr, ifr->ifr_data, sizeof(carpr)); + error = copyout(&carpr, ifr_data_get_ptr(ifr), + sizeof(carpr)); } else { int i, count; @@ -1759,7 +1760,8 @@ carp_ioctl(struct ifreq *ifr, u_long cmd, struct threa IFNET_FOREACH_CARP(ifp, sc) { carp_carprcp(&carpr, sc, priveleged); carpr.carpr_count = count; - error = copyout(&carpr, ifr->ifr_data + + error = copyout(&carpr, + (caddr_t)ifr_data_get_ptr(ifr) + (i * sizeof(carpr)), sizeof(carpr)); if (error) { CIF_UNLOCK(ifp->if_carp); Modified: stable/11/sys/netpfil/pf/if_pfsync.c ============================================================================== --- stable/11/sys/netpfil/pf/if_pfsync.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/netpfil/pf/if_pfsync.c Sun Apr 8 16:54:07 2018 (r332288) @@ -1317,7 +1317,8 @@ pfsyncioctl(struct ifnet *ifp, u_long cmd, caddr_t dat pfsyncr.pfsyncr_defer = (PFSYNCF_DEFER == (sc->sc_flags & PFSYNCF_DEFER)); PFSYNC_UNLOCK(sc); - return (copyout(&pfsyncr, ifr->ifr_data, sizeof(pfsyncr))); + return (copyout(&pfsyncr, ifr_data_get_ptr(ifr), + sizeof(pfsyncr))); case SIOCSETPFSYNC: { @@ -1328,7 +1329,8 @@ pfsyncioctl(struct ifnet *ifp, u_long cmd, caddr_t dat if ((error = priv_check(curthread, PRIV_NETINET_PF)) != 0) return (error); - if ((error = copyin(ifr->ifr_data, &pfsyncr, sizeof(pfsyncr)))) + if ((error = copyin(ifr_data_get_ptr(ifr), &pfsyncr, + sizeof(pfsyncr)))) return (error); if (pfsyncr.pfsyncr_maxupdates > 255) Modified: stable/11/sys/security/mac/mac_net.c ============================================================================== --- stable/11/sys/security/mac/mac_net.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/security/mac/mac_net.c Sun Apr 8 16:54:07 2018 (r332288) @@ -406,7 +406,7 @@ mac_ifnet_ioctl_get(struct ucred *cred, struct ifreq * if (!(mac_labeled & MPC_OBJECT_IFNET)) return (EINVAL); - error = copyin(ifr->ifr_ifru.ifru_data, &mac, sizeof(mac)); + error = copyin(ifr_data_get_ptr(ifr), &mac, sizeof(mac)); if (error) return (error); @@ -449,7 +449,7 @@ mac_ifnet_ioctl_set(struct ucred *cred, struct ifreq * if (!(mac_labeled & MPC_OBJECT_IFNET)) return (EINVAL); - error = copyin(ifr->ifr_ifru.ifru_data, &mac, sizeof(mac)); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Sun Apr 8 16:59:40 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EB10F90995; Sun, 8 Apr 2018 16:59:40 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C4B287C3FB; Sun, 8 Apr 2018 16:59:39 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF9D6129FE; Sun, 8 Apr 2018 16:59:39 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38GxdrL008126; Sun, 8 Apr 2018 16:59:39 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38GxdFE008124; Sun, 8 Apr 2018 16:59:39 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804081659.w38GxdFE008124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sun, 8 Apr 2018 16:59:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332290 - stable/11/sys/dev/de X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/11/sys/dev/de X-SVN-Commit-Revision: 332290 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 16:59:40 -0000 Author: brooks Date: Sun Apr 8 16:59:39 2018 New Revision: 332290 URL: https://svnweb.freebsd.org/changeset/base/332290 Log: GC never enabled support for SIOCGADDRROM and SIOCGCHIPID. When de(4) was imported in 1997 the world was not ready for these ioctls. In over 20 years that hasn't changed so it seems safe to assume their time will never come. Reviewed by: imp, jhb Approved by: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14889 Modified: stable/11/sys/dev/de/if_de.c stable/11/sys/dev/de/if_devar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/de/if_de.c ============================================================================== --- stable/11/sys/dev/de/if_de.c Sun Apr 8 16:55:28 2018 (r332289) +++ stable/11/sys/dev/de/if_de.c Sun Apr 8 16:59:39 2018 (r332290) @@ -4264,18 +4264,6 @@ tulip_ifioctl(struct ifnet * ifp, u_long cmd, caddr_t break; } -#ifdef SIOCGADDRROM - case SIOCGADDRROM: { - error = copyout(sc->tulip_rombuf, ifr_data_get_ptr(ifr), sizeof(sc->tulip_rombuf)); - break; - } -#endif -#ifdef SIOCGCHIPID - case SIOCGCHIPID: { - ifr->ifr_metric = (int) sc->tulip_chipid; - break; - } -#endif default: { error = ether_ioctl(ifp, cmd, data); break; Modified: stable/11/sys/dev/de/if_devar.h ============================================================================== --- stable/11/sys/dev/de/if_devar.h Sun Apr 8 16:55:28 2018 (r332289) +++ stable/11/sys/dev/de/if_devar.h Sun Apr 8 16:59:39 2018 (r332290) @@ -874,11 +874,6 @@ static const struct { #define TULIP_TXMAP_POSTSYNC(ri, di) \ _TULIP_MAP_SYNC(ri, di, BUS_DMASYNC_POSTWRITE) -#ifdef notyet -#define SIOCGADDRROM _IOW('i', 240, struct ifreq) /* get 128 bytes of ROM */ -#define SIOCGCHIPID _IOWR('i', 241, struct ifreq) /* get chipid */ -#endif - #if defined(TULIP_HDR_DATA) static tulip_softc_t *tulips[TULIP_MAX_DEVICES]; #endif From owner-svn-src-stable@freebsd.org Sun Apr 8 17:03:40 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5D65F91156; Sun, 8 Apr 2018 17:03:39 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 97D8F7E769; Sun, 8 Apr 2018 17:03:39 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 92AB812BA5; Sun, 8 Apr 2018 17:03:39 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38H3duS014075; Sun, 8 Apr 2018 17:03:39 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38H3dgR014073; Sun, 8 Apr 2018 17:03:39 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804081703.w38H3dgR014073@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sun, 8 Apr 2018 17:03:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332291 - stable/10/sys/dev/de X-SVN-Group: stable-10 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/10/sys/dev/de X-SVN-Commit-Revision: 332291 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 17:03:40 -0000 Author: brooks Date: Sun Apr 8 17:03:39 2018 New Revision: 332291 URL: https://svnweb.freebsd.org/changeset/base/332291 Log: MFC r331737: GC never enabled support for SIOCGADDRROM and SIOCGCHIPID. When de(4) was imported in 1997 the world was not ready for these ioctls. In over 20 years that hasn't changed so it seems safe to assume their time will never come. Reviewed by: imp, jhb Approved by: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14889 Modified: stable/10/sys/dev/de/if_de.c stable/10/sys/dev/de/if_devar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/de/if_de.c ============================================================================== --- stable/10/sys/dev/de/if_de.c Sun Apr 8 16:59:39 2018 (r332290) +++ stable/10/sys/dev/de/if_de.c Sun Apr 8 17:03:39 2018 (r332291) @@ -4263,18 +4263,6 @@ tulip_ifioctl(struct ifnet * ifp, u_long cmd, caddr_t break; } -#ifdef SIOCGADDRROM - case SIOCGADDRROM: { - error = copyout(sc->tulip_rombuf, ifr->ifr_data, sizeof(sc->tulip_rombuf)); - break; - } -#endif -#ifdef SIOCGCHIPID - case SIOCGCHIPID: { - ifr->ifr_metric = (int) sc->tulip_chipid; - break; - } -#endif default: { error = ether_ioctl(ifp, cmd, data); break; Modified: stable/10/sys/dev/de/if_devar.h ============================================================================== --- stable/10/sys/dev/de/if_devar.h Sun Apr 8 16:59:39 2018 (r332290) +++ stable/10/sys/dev/de/if_devar.h Sun Apr 8 17:03:39 2018 (r332291) @@ -874,11 +874,6 @@ static const struct { #define TULIP_TXMAP_POSTSYNC(ri, di) \ _TULIP_MAP_SYNC(ri, di, BUS_DMASYNC_POSTWRITE) -#ifdef notyet -#define SIOCGADDRROM _IOW('i', 240, struct ifreq) /* get 128 bytes of ROM */ -#define SIOCGCHIPID _IOWR('i', 241, struct ifreq) /* get chipid */ -#endif - #if defined(TULIP_HDR_DATA) static tulip_softc_t *tulips[TULIP_MAX_DEVICES]; #endif From owner-svn-src-stable@freebsd.org Sun Apr 8 17:15:20 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D317FF9213B; Sun, 8 Apr 2018 17:15:20 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B1988524E; Sun, 8 Apr 2018 17:15:19 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w38HFBEC014285; Sun, 8 Apr 2018 10:15:11 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w38HFB4t014284; Sun, 8 Apr 2018 10:15:11 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804081715.w38HFB4t014284@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r332290 - stable/11/sys/dev/de In-Reply-To: <201804081659.w38GxdFE008124@repo.freebsd.org> To: Brooks Davis Date: Sun, 8 Apr 2018 10:15:11 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 17:15:21 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: brooks > Date: Sun Apr 8 16:59:39 2018 > New Revision: 332290 > URL: https://svnweb.freebsd.org/changeset/base/332290 > > Log: MFC r331737: > GC never enabled support for SIOCGADDRROM and SIOCGCHIPID. > > When de(4) was imported in 1997 the world was not ready for these ioctls. > In over 20 years that hasn't changed so it seems safe to assume their > time will never come. > > Reviewed by: imp, jhb > Approved by: CheriBSD > Sponsored by: DARPA, AFRL > Differential Revision: https://reviews.freebsd.org/D14889 > > Modified: > stable/11/sys/dev/de/if_de.c > stable/11/sys/dev/de/if_devar.h > Directory Properties: > stable/11/ (props changed) > > Modified: stable/11/sys/dev/de/if_de.c > ============================================================================== > --- stable/11/sys/dev/de/if_de.c Sun Apr 8 16:55:28 2018 (r332289) > +++ stable/11/sys/dev/de/if_de.c Sun Apr 8 16:59:39 2018 (r332290) > @@ -4264,18 +4264,6 @@ tulip_ifioctl(struct ifnet * ifp, u_long cmd, caddr_t > break; > } > > -#ifdef SIOCGADDRROM > - case SIOCGADDRROM: { > - error = copyout(sc->tulip_rombuf, ifr_data_get_ptr(ifr), sizeof(sc->tulip_rombuf)); > - break; > - } > -#endif > -#ifdef SIOCGCHIPID > - case SIOCGCHIPID: { > - ifr->ifr_metric = (int) sc->tulip_chipid; > - break; > - } > -#endif > default: { > error = ether_ioctl(ifp, cmd, data); > break; > > Modified: stable/11/sys/dev/de/if_devar.h > ============================================================================== > --- stable/11/sys/dev/de/if_devar.h Sun Apr 8 16:55:28 2018 (r332289) > +++ stable/11/sys/dev/de/if_devar.h Sun Apr 8 16:59:39 2018 (r332290) > @@ -874,11 +874,6 @@ static const struct { > #define TULIP_TXMAP_POSTSYNC(ri, di) \ > _TULIP_MAP_SYNC(ri, di, BUS_DMASYNC_POSTWRITE) > > -#ifdef notyet > -#define SIOCGADDRROM _IOW('i', 240, struct ifreq) /* get 128 bytes of ROM */ > -#define SIOCGCHIPID _IOWR('i', 241, struct ifreq) /* get chipid */ > -#endif > - > #if defined(TULIP_HDR_DATA) > static tulip_softc_t *tulips[TULIP_MAX_DEVICES]; > #endif > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-stable@freebsd.org Sun Apr 8 17:18:51 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3E26F925A4; Sun, 8 Apr 2018 17:18:51 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7326C87386; Sun, 8 Apr 2018 17:18:51 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6DB8B12D57; Sun, 8 Apr 2018 17:18:51 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38HIpgG019631; Sun, 8 Apr 2018 17:18:51 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38HIpL5019630; Sun, 8 Apr 2018 17:18:51 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804081718.w38HIpL5019630@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sun, 8 Apr 2018 17:18:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332294 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 332294 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 17:18:51 -0000 Author: brooks Date: Sun Apr 8 17:18:51 2018 New Revision: 332294 URL: https://svnweb.freebsd.org/changeset/base/332294 Log: MFC r332087: ifconf(): Always zero the whole struct ifreq. The previous split of zeroing ifr_name and ifr_addr seperately is safe on current architectures, but would be unsafe if pointers were larger than 8 bytes. Combining the zeroing adds no real cost (a few instructions) and makes the security property easier to verify. Reviewed by: kib, emaste Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14912 Modified: stable/11/sys/net/if.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/if.c ============================================================================== --- stable/11/sys/net/if.c Sun Apr 8 17:10:32 2018 (r332293) +++ stable/11/sys/net/if.c Sun Apr 8 17:18:51 2018 (r332294) @@ -3123,10 +3123,10 @@ again: int addrs; /* - * Zero the ifr_name buffer to make sure we don't - * disclose the contents of the stack. + * Zero the ifr to make sure we don't disclose the contents + * of the stack. */ - memset(ifr.ifr_name, 0, sizeof(ifr.ifr_name)); + memset(&ifr, 0, sizeof(ifr)); if (strlcpy(ifr.ifr_name, ifp->if_xname, sizeof(ifr.ifr_name)) >= sizeof(ifr.ifr_name)) { @@ -3169,7 +3169,6 @@ again: } IF_ADDR_RUNLOCK(ifp); if (addrs == 0) { - bzero((caddr_t)&ifr.ifr_addr, sizeof(ifr.ifr_addr)); sbuf_bcat(sb, &ifr, sizeof(ifr)); max_len += sizeof(ifr); From owner-svn-src-stable@freebsd.org Sun Apr 8 17:23:34 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FFD7F92CA2; Sun, 8 Apr 2018 17:23:34 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D0D5F6A040; Sun, 8 Apr 2018 17:23:33 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CBD9512EFD; Sun, 8 Apr 2018 17:23:33 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38HNXdk024805; Sun, 8 Apr 2018 17:23:33 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38HNXpP024804; Sun, 8 Apr 2018 17:23:33 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804081723.w38HNXpP024804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sun, 8 Apr 2018 17:23:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332295 - stable/10/sys/net X-SVN-Group: stable-10 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/10/sys/net X-SVN-Commit-Revision: 332295 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 17:23:34 -0000 Author: brooks Date: Sun Apr 8 17:23:33 2018 New Revision: 332295 URL: https://svnweb.freebsd.org/changeset/base/332295 Log: MFC r332087: ifconf(): Always zero the whole struct ifreq. The previous split of zeroing ifr_name and ifr_addr seperately is safe on current architectures, but would be unsafe if pointers were larger than 8 bytes. Combining the zeroing adds no real cost (a few instructions) and makes the security property easier to verify. Reviewed by: kib, emaste Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14912 Modified: stable/10/sys/net/if.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/if.c ============================================================================== --- stable/10/sys/net/if.c Sun Apr 8 17:18:51 2018 (r332294) +++ stable/10/sys/net/if.c Sun Apr 8 17:23:33 2018 (r332295) @@ -3024,10 +3024,10 @@ again: int addrs; /* - * Zero the ifr_name buffer to make sure we don't - * disclose the contents of the stack. + * Zero the ifr to make sure we don't disclose the contents + * of the stack. */ - memset(ifr.ifr_name, 0, sizeof(ifr.ifr_name)); + memset(&ifr, 0, sizeof(ifr)); if (strlcpy(ifr.ifr_name, ifp->if_xname, sizeof(ifr.ifr_name)) >= sizeof(ifr.ifr_name)) { @@ -3071,7 +3071,6 @@ again: } IF_ADDR_RUNLOCK(ifp); if (addrs == 0) { - bzero((caddr_t)&ifr.ifr_addr, sizeof(ifr.ifr_addr)); sbuf_bcat(sb, &ifr, sizeof(ifr)); max_len += sizeof(ifr); From owner-svn-src-stable@freebsd.org Sun Apr 8 20:26:51 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02088FA032A; Sun, 8 Apr 2018 20:26:51 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AADFB6F5B1; Sun, 8 Apr 2018 20:26:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A2E6314CE2; Sun, 8 Apr 2018 20:26:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38KQoH7020884; Sun, 8 Apr 2018 20:26:50 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38KQoeC020883; Sun, 8 Apr 2018 20:26:50 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804082026.w38KQoeC020883@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 8 Apr 2018 20:26:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332300 - stable/11/share/mk X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/share/mk X-SVN-Commit-Revision: 332300 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 20:26:51 -0000 Author: emaste Date: Sun Apr 8 20:26:50 2018 New Revision: 332300 URL: https://svnweb.freebsd.org/changeset/base/332300 Log: MFC r320243 (bdrewery): Fix spelling error. Modified: stable/11/share/mk/bsd.compiler.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/share/mk/bsd.compiler.mk ============================================================================== --- stable/11/share/mk/bsd.compiler.mk Sun Apr 8 19:33:05 2018 (r332299) +++ stable/11/share/mk/bsd.compiler.mk Sun Apr 8 20:26:50 2018 (r332300) @@ -9,7 +9,7 @@ # # COMPILER_VERSION is a numeric constant equal to: # major * 10000 + minor * 100 + tiny -# It too can be overriden on the command line. When testing it, be sure to +# It too can be overridden on the command line. When testing it, be sure to # make sure that you are limiting the test to a specific compiler. Testing # against 30300 for gcc likely isn't what you wanted (since versions of gcc # prior to 4.2 likely have no prayer of working). From owner-svn-src-stable@freebsd.org Sun Apr 8 20:28:38 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 820FCFA0564; Sun, 8 Apr 2018 20:28:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 31D127059F; Sun, 8 Apr 2018 20:28:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C99414CE4; Sun, 8 Apr 2018 20:28:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38KScc8021002; Sun, 8 Apr 2018 20:28:38 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38KSbtT020999; Sun, 8 Apr 2018 20:28:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804082028.w38KSbtT020999@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 8 Apr 2018 20:28:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332301 - in stable/11: . share/mk X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable/11: . share/mk X-SVN-Commit-Revision: 332301 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 20:28:38 -0000 Author: emaste Date: Sun Apr 8 20:28:37 2018 New Revision: 332301 URL: https://svnweb.freebsd.org/changeset/base/332301 Log: MFC r328972: add retpoline compiler and linker feature flags These features indicate that the compiler and linker support the retpoline speculative execution vulnerability (CVE-2017-5715) mitigation. Modified: stable/11/Makefile.inc1 stable/11/share/mk/bsd.compiler.mk stable/11/share/mk/bsd.linker.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/Makefile.inc1 ============================================================================== --- stable/11/Makefile.inc1 Sun Apr 8 20:26:50 2018 (r332300) +++ stable/11/Makefile.inc1 Sun Apr 8 20:28:37 2018 (r332301) @@ -166,11 +166,11 @@ test-system-compiler: .PHONY .if !defined(X_COMPILER_TYPE) CROSSENV+= COMPILER_VERSION=${COMPILER_VERSION} \ COMPILER_TYPE=${COMPILER_TYPE} \ - COMPILER_FEATURES=${COMPILER_FEATURES} \ + COMPILER_FEATURES="${COMPILER_FEATURES}" \ COMPILER_FREEBSD_VERSION=${COMPILER_FREEBSD_VERSION} .else CROSSENV+= COMPILER_VERSION=${X_COMPILER_VERSION} \ - COMPILER_FEATURES=${X_COMPILER_FEATURES} \ + COMPILER_FEATURES="${X_COMPILER_FEATURES}" \ COMPILER_TYPE=${X_COMPILER_TYPE} \ COMPILER_FREEBSD_VERSION=${X_COMPILER_FREEBSD_VERSION} .endif Modified: stable/11/share/mk/bsd.compiler.mk ============================================================================== --- stable/11/share/mk/bsd.compiler.mk Sun Apr 8 20:26:50 2018 (r332300) +++ stable/11/share/mk/bsd.compiler.mk Sun Apr 8 20:28:37 2018 (r332301) @@ -19,7 +19,9 @@ # COMPILER_FEATURES will contain one or more of the following, based on # compiler support for that feature: # -# - c++11 : supports full (or nearly full) C++11 programming environment. +# - c++11: supports full (or nearly full) C++11 programming environment. +# - retpoline: supports the retpoline speculative execution vulnerability +# mitigation. # # These variables with an X_ prefix will also be provided if XCC is set. # @@ -168,11 +170,13 @@ ${X_}COMPILER_FREEBSD_VERSION= unknown .endif .endif +${X_}COMPILER_FEATURES= .if ${${X_}COMPILER_TYPE} == "clang" || \ (${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 40800) -${X_}COMPILER_FEATURES= c++11 -.else -${X_}COMPILER_FEATURES= +${X_}COMPILER_FEATURES+= c++11 +.endif +.if ${${X_}COMPILER_TYPE} == "clang" && ${${X_}COMPILER_VERSION} >= 60000 +${X_}COMPILER_FEATURES+= retpoline .endif .else Modified: stable/11/share/mk/bsd.linker.mk ============================================================================== --- stable/11/share/mk/bsd.linker.mk Sun Apr 8 20:26:50 2018 (r332300) +++ stable/11/share/mk/bsd.linker.mk Sun Apr 8 20:28:37 2018 (r332301) @@ -12,7 +12,9 @@ # LINKER_FEATURES may contain one or more of the following, based on # linker support for that feature: # -# - build-id : support for generating a Build-ID note +# - build-id: support for generating a Build-ID note +# - retpoline: support for generating PLT with retpoline speculative +# execution vulnerability mitigation # # These variables with an X_ prefix will also be provided if XLD is set. # @@ -72,6 +74,9 @@ ${X_}LINKER_FEATURES+= build-id .endif .if ${${X_}LINKER_TYPE} != "lld" || ${${X_}LINKER_VERSION} >= 50000 ${X_}LINKER_FEATURES+= filter +.endif +.if ${${X_}LINKER_TYPE} == "lld" && ${${X_}LINKER_VERSION} >= 60000 +${X_}LINKER_FEATURES+= retpoline .endif .endif .else From owner-svn-src-stable@freebsd.org Sun Apr 8 20:30:53 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61D06FA08C4; Sun, 8 Apr 2018 20:30:53 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F552719AF; Sun, 8 Apr 2018 20:30:53 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0892B14D01; Sun, 8 Apr 2018 20:30:53 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38KUqam023382; Sun, 8 Apr 2018 20:30:52 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38KUq0s023381; Sun, 8 Apr 2018 20:30:52 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804082030.w38KUq0s023381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 8 Apr 2018 20:30:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332302 - stable/11/usr.bin/vtfontcvt X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/usr.bin/vtfontcvt X-SVN-Commit-Revision: 332302 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 20:30:53 -0000 Author: emaste Date: Sun Apr 8 20:30:52 2018 New Revision: 332302 URL: https://svnweb.freebsd.org/changeset/base/332302 Log: MFC r331935: vtfontcvt: allow .bdf characters less than full height Sponsored by: The FreeBSD Foundation Modified: stable/11/usr.bin/vtfontcvt/vtfontcvt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- stable/11/usr.bin/vtfontcvt/vtfontcvt.c Sun Apr 8 20:28:37 2018 (r332301) +++ stable/11/usr.bin/vtfontcvt/vtfontcvt.c Sun Apr 8 20:30:52 2018 (r332302) @@ -265,10 +265,23 @@ parse_bdf(FILE *fp, unsigned int map_idx) if (strncmp(ln, "BITMAP", 6) == 0 && (ln[6] == ' ' || ln[6] == '\0')) { + /* + * Assume that the next _height_ lines are bitmap + * data. ENDCHAR is allowed to terminate the bitmap + * early but is not otherwise checked; any extra data + * is ignored. + */ for (i = 0; i < height; i++) { if ((ln = fgetln(fp, &length)) == NULL) errx(1, "Unexpected EOF!\n"); ln[length - 1] = '\0'; + if (strcmp(ln, "ENDCHAR") == 0) { + memset(bytes + i * wbytes, 0, + (height - i) * wbytes); + memset(bytes_r + i * wbytes, 0, + (height - i) * wbytes); + break; + } sscanf(ln, "%x", &line); if (parse_bitmap_line(bytes + i * wbytes, bytes_r + i * wbytes, line, dwidth) != 0) From owner-svn-src-stable@freebsd.org Sun Apr 8 20:50:17 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB9BBFA1E72; Sun, 8 Apr 2018 20:50:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7DA907C37C; Sun, 8 Apr 2018 20:50:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76F1315022; Sun, 8 Apr 2018 20:50:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38KoHQH031650; Sun, 8 Apr 2018 20:50:17 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38KoHug031646; Sun, 8 Apr 2018 20:50:17 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804082050.w38KoHug031646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 8 Apr 2018 20:50:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332303 - stable/11/sys/dev/ath X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/dev/ath X-SVN-Commit-Revision: 332303 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 20:50:18 -0000 Author: emaste Date: Sun Apr 8 20:50:16 2018 New Revision: 332303 URL: https://svnweb.freebsd.org/changeset/base/332303 Log: MFC ath(4) potential memory disclosure fixes [1] r327499: ath: fix memory disclosure from ath_btcoex_ioctl The ath_btcoex_ioctl handler allocated a buffer without M_ZERO and returned it to userland without writing to it. The device has permissions only for root so this is not urgent, and the fix can be MFCd and considered for a future EN. [2] r327500: ath: fix possible memory disclosures in ioctl handlers Apply the fix from r327499 to additional ioctl handlers. [3] r327529: ath: fix possible memory disclosure in ioctl handler Submitted by: Domagoj Stolfa [1,3] Reported by: Ilja van Sprundel [1,2] Reviewed by: adrian [1] Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/dev/ath/if_ath_btcoex.c stable/11/sys/dev/ath/if_ath_ioctl.c stable/11/sys/dev/ath/if_ath_lna_div.c stable/11/sys/dev/ath/if_ath_spectral.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ath/if_ath_btcoex.c ============================================================================== --- stable/11/sys/dev/ath/if_ath_btcoex.c Sun Apr 8 20:30:52 2018 (r332302) +++ stable/11/sys/dev/ath/if_ath_btcoex.c Sun Apr 8 20:50:16 2018 (r332303) @@ -457,7 +457,7 @@ ath_btcoex_ioctl(struct ath_softc *sc, struct ath_diag * pointer for us to use below in reclaiming the buffer; * may want to be more defensive. */ - outdata = malloc(outsize, M_TEMP, M_NOWAIT); + outdata = malloc(outsize, M_TEMP, M_NOWAIT | M_ZERO); if (outdata == NULL) { error = ENOMEM; goto bad; @@ -466,6 +466,7 @@ ath_btcoex_ioctl(struct ath_softc *sc, struct ath_diag switch (id) { default: error = EINVAL; + goto bad; } if (outsize < ad->ad_out_size) ad->ad_out_size = outsize; Modified: stable/11/sys/dev/ath/if_ath_ioctl.c ============================================================================== --- stable/11/sys/dev/ath/if_ath_ioctl.c Sun Apr 8 20:30:52 2018 (r332302) +++ stable/11/sys/dev/ath/if_ath_ioctl.c Sun Apr 8 20:50:16 2018 (r332303) @@ -197,7 +197,7 @@ ath_ioctl_diag(struct ath_softc *sc, struct ath_diag * * pointer for us to use below in reclaiming the buffer; * may want to be more defensive. */ - outdata = malloc(outsize, M_TEMP, M_NOWAIT); + outdata = malloc(outsize, M_TEMP, M_NOWAIT | M_ZERO); if (outdata == NULL) { error = ENOMEM; goto bad; Modified: stable/11/sys/dev/ath/if_ath_lna_div.c ============================================================================== --- stable/11/sys/dev/ath/if_ath_lna_div.c Sun Apr 8 20:30:52 2018 (r332302) +++ stable/11/sys/dev/ath/if_ath_lna_div.c Sun Apr 8 20:50:16 2018 (r332303) @@ -187,7 +187,7 @@ ath_lna_div_ioctl(struct ath_softc *sc, struct ath_dia * pointer for us to use below in reclaiming the buffer; * may want to be more defensive. */ - outdata = malloc(outsize, M_TEMP, M_NOWAIT); + outdata = malloc(outsize, M_TEMP, M_NOWAIT | M_ZERO); if (outdata == NULL) { error = ENOMEM; goto bad; @@ -196,6 +196,7 @@ ath_lna_div_ioctl(struct ath_softc *sc, struct ath_dia switch (id) { default: error = EINVAL; + goto bad; } if (outsize < ad->ad_out_size) ad->ad_out_size = outsize; Modified: stable/11/sys/dev/ath/if_ath_spectral.c ============================================================================== --- stable/11/sys/dev/ath/if_ath_spectral.c Sun Apr 8 20:30:52 2018 (r332302) +++ stable/11/sys/dev/ath/if_ath_spectral.c Sun Apr 8 20:50:16 2018 (r332303) @@ -212,7 +212,7 @@ ath_ioctl_spectral(struct ath_softc *sc, struct ath_di * pointer for us to use below in reclaiming the buffer; * may want to be more defensive. */ - outdata = malloc(outsize, M_TEMP, M_NOWAIT); + outdata = malloc(outsize, M_TEMP, M_NOWAIT | M_ZERO); if (outdata == NULL) { error = ENOMEM; goto bad; @@ -275,6 +275,7 @@ ath_ioctl_spectral(struct ath_softc *sc, struct ath_di break; default: error = EINVAL; + goto bad; } if (outsize < ad->ad_out_size) ad->ad_out_size = outsize; From owner-svn-src-stable@freebsd.org Sun Apr 8 20:52:10 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D6FAFA21E4; Sun, 8 Apr 2018 20:52:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E0437D62D; Sun, 8 Apr 2018 20:52:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 28FAD15195; Sun, 8 Apr 2018 20:52:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38KqAfT036126; Sun, 8 Apr 2018 20:52:10 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38Kq9P0036124; Sun, 8 Apr 2018 20:52:09 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804082052.w38Kq9P0036124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 8 Apr 2018 20:52:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332304 - in stable/11/sys/x86: isa x86 X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable/11/sys/x86: isa x86 X-SVN-Commit-Revision: 332304 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 20:52:10 -0000 Author: emaste Date: Sun Apr 8 20:52:09 2018 New Revision: 332304 URL: https://svnweb.freebsd.org/changeset/base/332304 Log: MFC r331082: ANSIfy sys/x86 Modified: stable/11/sys/x86/isa/isa_dma.c stable/11/sys/x86/x86/autoconf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/isa/isa_dma.c ============================================================================== --- stable/11/sys/x86/isa/isa_dma.c Sun Apr 8 20:50:16 2018 (r332303) +++ stable/11/sys/x86/isa/isa_dma.c Sun Apr 8 20:52:09 2018 (r332304) @@ -144,8 +144,7 @@ isa_dma_init(int chan, u_int bouncebufsize, int flag) * in open() or during its initialization. */ int -isa_dma_acquire(chan) - int chan; +isa_dma_acquire(int chan) { #ifdef DIAGNOSTIC if (chan & ~VALID_DMA_MASK) @@ -170,8 +169,7 @@ isa_dma_acquire(chan) * during close() or during its shutdown. */ void -isa_dma_release(chan) - int chan; +isa_dma_release(int chan) { #ifdef DIAGNOSTIC if (chan & ~VALID_DMA_MASK) @@ -205,8 +203,7 @@ isa_dma_release(chan) * external dma control by a board. */ void -isa_dmacascade(chan) - int chan; +isa_dmacascade(int chan) { #ifdef DIAGNOSTIC if (chan & ~VALID_DMA_MASK) Modified: stable/11/sys/x86/x86/autoconf.c ============================================================================== --- stable/11/sys/x86/x86/autoconf.c Sun Apr 8 20:50:16 2018 (r332303) +++ stable/11/sys/x86/x86/autoconf.c Sun Apr 8 20:52:09 2018 (r332304) @@ -90,8 +90,7 @@ SYSINIT(configure3, SI_SUB_CONFIGURE, SI_ORDER_ANY, co * Determine i/o configuration for a machine. */ static void -configure_first(dummy) - void *dummy; +configure_first(void *dummy) { /* nexus0 is the top of the x86 device tree */ @@ -99,8 +98,7 @@ configure_first(dummy) } static void -configure(dummy) - void *dummy; +configure(void *dummy) { /* initialize new bus architecture */ @@ -117,8 +115,7 @@ configure(dummy) } static void -configure_final(dummy) - void *dummy; +configure_final(void *dummy) { cninit_finish(); From owner-svn-src-stable@freebsd.org Sun Apr 8 20:54:14 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44D4DFA24E5; Sun, 8 Apr 2018 20:54:14 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD3827E9CC; Sun, 8 Apr 2018 20:54:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6169151C4; Sun, 8 Apr 2018 20:54:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38KsDOt036301; Sun, 8 Apr 2018 20:54:13 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38KsDeB036297; Sun, 8 Apr 2018 20:54:13 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804082054.w38KsDeB036297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 8 Apr 2018 20:54:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332306 - in stable/11: sys/conf tools/build/options X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable/11: sys/conf tools/build/options X-SVN-Commit-Revision: 332306 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 20:54:14 -0000 Author: emaste Date: Sun Apr 8 20:54:13 2018 New Revision: 332306 URL: https://svnweb.freebsd.org/changeset/base/332306 Log: MFC r330110: Add kernel retpoline option for amd64 Retpoline is a compiler-based mitigation for CVE-2017-5715, also known as Spectre V2, that protects against speculative execution branch target injection attacks. In this commit it is disabled by default, but will be changed in a followup commit. MFC r330962: Remove KERNEL_RETPOLINE from BROKEN_OPTIONS on i386 Clang will compile both amd64 and i386 with retpoline. Sponsored by: The FreeBSD Foundation Added: stable/11/tools/build/options/WITHOUT_KERNEL_RETPOLINE - copied unchanged from r330110, head/tools/build/options/WITHOUT_KERNEL_RETPOLINE stable/11/tools/build/options/WITH_KERNEL_RETPOLINE - copied unchanged from r330110, head/tools/build/options/WITH_KERNEL_RETPOLINE Modified: stable/11/sys/conf/kern.mk stable/11/sys/conf/kern.opts.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/kern.mk ============================================================================== --- stable/11/sys/conf/kern.mk Sun Apr 8 20:53:00 2018 (r332305) +++ stable/11/sys/conf/kern.mk Sun Apr 8 20:54:13 2018 (r332306) @@ -192,7 +192,7 @@ CFLAGS+= -ffreestanding # gcc and clang opimizers take advantage of this. The kernel makes # use of signed integer wraparound mechanics so we need the compiler # to treat it as a wraparound and not take shortcuts. -# +# CFLAGS+= -fwrapv # @@ -201,6 +201,14 @@ CFLAGS+= -fwrapv .if ${MK_SSP} != "no" && \ ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" CFLAGS+= -fstack-protector +.endif + +# +# Retpoline speculative execution vulnerability mitigation (CVE-2017-5715) +# +.if defined(COMPILER_FEATURES) && ${COMPILER_FEATURES:Mretpoline} != "" && \ + ${MK_KERNEL_RETPOLINE} != "no" +CFLAGS+= -mretpoline .endif # Modified: stable/11/sys/conf/kern.opts.mk ============================================================================== --- stable/11/sys/conf/kern.opts.mk Sun Apr 8 20:53:00 2018 (r332305) +++ stable/11/sys/conf/kern.opts.mk Sun Apr 8 20:54:13 2018 (r332306) @@ -48,6 +48,7 @@ __DEFAULT_YES_OPTIONS = \ __DEFAULT_NO_OPTIONS = \ EISA \ EXTRA_TCP_STACKS \ + KERNEL_RETPOLINE \ NAND \ OFED \ REPRODUCIBLE_BUILD @@ -83,6 +84,11 @@ BROKEN_OPTIONS+= EISA .if ${MACHINE} != "i386" && ${MACHINE} != "amd64" BROKEN_OPTIONS+= OFED +.endif + +# Things that don't work based on toolchain support. +.if ${MACHINE} != "i386" && ${MACHINE} != "amd64" +BROKEN_OPTIONS+= KERNEL_RETPOLINE .endif # expanded inline from bsd.mkopt.mk to avoid share/mk dependency Copied: stable/11/tools/build/options/WITHOUT_KERNEL_RETPOLINE (from r330110, head/tools/build/options/WITHOUT_KERNEL_RETPOLINE) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/tools/build/options/WITHOUT_KERNEL_RETPOLINE Sun Apr 8 20:54:13 2018 (r332306, copy of r330110, head/tools/build/options/WITHOUT_KERNEL_RETPOLINE) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to disable the "retpoline" mitigation for CVE-2017-5715 in the kernel +build. Copied: stable/11/tools/build/options/WITH_KERNEL_RETPOLINE (from r330110, head/tools/build/options/WITH_KERNEL_RETPOLINE) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/tools/build/options/WITH_KERNEL_RETPOLINE Sun Apr 8 20:54:13 2018 (r332306, copy of r330110, head/tools/build/options/WITH_KERNEL_RETPOLINE) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to enable the "retpoline" mitigation for CVE-2017-5715 in the kernel +build. From owner-svn-src-stable@freebsd.org Sun Apr 8 20:58:14 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31382FA292B; Sun, 8 Apr 2018 20:58:14 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D0DB880CBC; Sun, 8 Apr 2018 20:58:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C69ED151CA; Sun, 8 Apr 2018 20:58:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38KwDwO036521; Sun, 8 Apr 2018 20:58:13 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38KwDne036520; Sun, 8 Apr 2018 20:58:13 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804082058.w38KwDne036520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 8 Apr 2018 20:58:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332307 - stable/11/share/man/man5 X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/share/man/man5 X-SVN-Commit-Revision: 332307 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 20:58:14 -0000 Author: emaste Date: Sun Apr 8 20:58:13 2018 New Revision: 332307 URL: https://svnweb.freebsd.org/changeset/base/332307 Log: Regen src.conf.5 after r332306 (WITH_KERNEL_RETPOLINE MFC) Modified: stable/11/share/man/man5/src.conf.5 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man5/src.conf.5 ============================================================================== --- stable/11/share/man/man5/src.conf.5 Sun Apr 8 20:54:13 2018 (r332306) +++ stable/11/share/man/man5/src.conf.5 Sun Apr 8 20:58:13 2018 (r332307) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd April 6, 2018 +.Dd April 8, 2018 .Dt SRC.CONF 5 .Os .Sh NAME @@ -870,6 +870,9 @@ Set to build some programs without Kerberos support, l .Xr sshd 8 , and .Xr telnetd 8 . +.It Va WITH_KERNEL_RETPOLINE +Set to enable the "retpoline" mitigation for CVE-2017-5715 in the kernel +build. .It Va WITHOUT_KERNEL_SYMBOLS Set to not install kernel symbol files. .Bf -symbolic From owner-svn-src-stable@freebsd.org Sun Apr 8 21:56:36 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 009B9F83B3F; Sun, 8 Apr 2018 21:56:36 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A2A218193D; Sun, 8 Apr 2018 21:56:35 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9AA9915BD8; Sun, 8 Apr 2018 21:56:35 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38LuZws066747; Sun, 8 Apr 2018 21:56:35 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38LuZNW066746; Sun, 8 Apr 2018 21:56:35 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201804082156.w38LuZNW066746@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 8 Apr 2018 21:56:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332308 - stable/11/include X-SVN-Group: stable-11 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/11/include X-SVN-Commit-Revision: 332308 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 21:56:36 -0000 Author: pfg Date: Sun Apr 8 21:56:35 2018 New Revision: 332308 URL: https://svnweb.freebsd.org/changeset/base/332308 Log: MFC r331969, r332035: pthread.h: drop nullability attributes. These have been found to be practically useless. We were actually following the Android bionic library and had some interest in replicating the same warnings and behaviour but Android has since removed them. We are still keeping some uses of nullability attributes in other headers, somewhat in line with Apple's libc. Hinted by: bionic (git 3f66e74b903905e763e104396aff52a81718cfde) Modified: stable/11/include/pthread.h Directory Properties: stable/11/ (props changed) Modified: stable/11/include/pthread.h ============================================================================== --- stable/11/include/pthread.h Sun Apr 8 20:58:13 2018 (r332307) +++ stable/11/include/pthread.h Sun Apr 8 21:56:35 2018 (r332308) @@ -46,8 +46,6 @@ #include #include -__NULLABILITY_PRAGMA_PUSH - /* * Run-time invariant values: */ @@ -149,35 +147,33 @@ struct _pthread_cleanup_info { */ __BEGIN_DECLS int pthread_atfork(void (*)(void), void (*)(void), void (*)(void)); -int pthread_attr_destroy(pthread_attr_t * _Nonnull); +int pthread_attr_destroy(pthread_attr_t *); int pthread_attr_getstack( - const pthread_attr_t * _Nonnull __restrict, - void ** _Nonnull __restrict, - size_t * _Nonnull __restrict); -int pthread_attr_getstacksize(const pthread_attr_t * _Nonnull, - size_t * _Nonnull); -int pthread_attr_getguardsize(const pthread_attr_t * _Nonnull, - size_t * _Nonnull); + const pthread_attr_t * __restrict, void ** __restrict, + size_t * __restrict); +int pthread_attr_getstacksize(const pthread_attr_t *, + size_t *); +int pthread_attr_getguardsize(const pthread_attr_t *, + size_t *); int pthread_attr_getstackaddr(const pthread_attr_t *, void **); -int pthread_attr_getdetachstate(const pthread_attr_t * _Nonnull, - int * _Nonnull); -int pthread_attr_init(pthread_attr_t * _Nonnull); -int pthread_attr_setstacksize(pthread_attr_t * _Nonnull, size_t); -int pthread_attr_setguardsize(pthread_attr_t * _Nonnull, size_t); -int pthread_attr_setstack(pthread_attr_t * _Nonnull, void *, +int pthread_attr_getdetachstate(const pthread_attr_t *, + int *); +int pthread_attr_init(pthread_attr_t *); +int pthread_attr_setstacksize(pthread_attr_t *, size_t); +int pthread_attr_setguardsize(pthread_attr_t *, size_t); +int pthread_attr_setstack(pthread_attr_t *, void *, size_t); int pthread_attr_setstackaddr(pthread_attr_t *, void *); -int pthread_attr_setdetachstate(pthread_attr_t * _Nonnull, int); -int pthread_barrier_destroy(pthread_barrier_t * _Nonnull); -int pthread_barrier_init(pthread_barrier_t * _Nonnull, +int pthread_attr_setdetachstate(pthread_attr_t *, int); +int pthread_barrier_destroy(pthread_barrier_t *); +int pthread_barrier_init(pthread_barrier_t *, const pthread_barrierattr_t *, unsigned); -int pthread_barrier_wait(pthread_barrier_t * _Nonnull); -int pthread_barrierattr_destroy(pthread_barrierattr_t * _Nonnull); +int pthread_barrier_wait(pthread_barrier_t *); +int pthread_barrierattr_destroy(pthread_barrierattr_t *); int pthread_barrierattr_getpshared( - const pthread_barrierattr_t * _Nonnull, int * _Nonnull); -int pthread_barrierattr_init(pthread_barrierattr_t * _Nonnull); -int pthread_barrierattr_setpshared(pthread_barrierattr_t * _Nonnull, - int); + const pthread_barrierattr_t *, int *); +int pthread_barrierattr_init(pthread_barrierattr_t *); +int pthread_barrierattr_setpshared(pthread_barrierattr_t *, int); #define pthread_cleanup_push(cleanup_routine, cleanup_arg) \ { \ @@ -192,108 +188,99 @@ int pthread_barrierattr_setpshared(pthread_barrieratt __pthread_cleanup_pop_imp(execute); \ } -int pthread_condattr_destroy(pthread_condattr_t * _Nonnull); -int pthread_condattr_getclock(const pthread_condattr_t * _Nonnull, - clockid_t * _Nonnull); -int pthread_condattr_getpshared(const pthread_condattr_t * _Nonnull, - int * _Nonnull); -int pthread_condattr_init(pthread_condattr_t * _Nonnull); -int pthread_condattr_setclock(pthread_condattr_t * _Nonnull, - clockid_t); -int pthread_condattr_setpshared(pthread_condattr_t * _Nonnull, int); -int pthread_cond_broadcast(pthread_cond_t * _Nonnull); -int pthread_cond_destroy(pthread_cond_t * _Nonnull); -int pthread_cond_init(pthread_cond_t * _Nonnull, - const pthread_condattr_t *); -int pthread_cond_signal(pthread_cond_t * _Nonnull); -int pthread_cond_timedwait(pthread_cond_t * _Nonnull, - pthread_mutex_t * _Nonnull __mutex, - const struct timespec * _Nonnull) +int pthread_condattr_destroy(pthread_condattr_t *); +int pthread_condattr_getclock(const pthread_condattr_t *, + clockid_t *); +int pthread_condattr_getpshared(const pthread_condattr_t *, int *); +int pthread_condattr_init(pthread_condattr_t *); +int pthread_condattr_setclock(pthread_condattr_t *, clockid_t); +int pthread_condattr_setpshared(pthread_condattr_t *, int); +int pthread_cond_broadcast(pthread_cond_t *); +int pthread_cond_destroy(pthread_cond_t *); +int pthread_cond_init(pthread_cond_t *, const pthread_condattr_t *); +int pthread_cond_signal(pthread_cond_t *); +int pthread_cond_timedwait(pthread_cond_t *, + pthread_mutex_t * __mutex, + const struct timespec *) __requires_exclusive(*__mutex); -int pthread_cond_wait(pthread_cond_t * _Nonnull, - pthread_mutex_t * _Nonnull __mutex) +int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t * __mutex) __requires_exclusive(*__mutex); -int pthread_create(pthread_t * _Nonnull, const pthread_attr_t *, - void *(* _Nonnull) (void *), void *); +int pthread_create(pthread_t *, const pthread_attr_t *, + void *(*) (void *), void *); int pthread_detach(pthread_t); int pthread_equal(pthread_t, pthread_t); void pthread_exit(void *) __dead2; void *pthread_getspecific(pthread_key_t); -int pthread_getcpuclockid(pthread_t, clockid_t * _Nonnull); +int pthread_getcpuclockid(pthread_t, clockid_t *); int pthread_join(pthread_t, void **); -int pthread_key_create(pthread_key_t * _Nonnull, - void (*) (void *)); +int pthread_key_create(pthread_key_t *, void (*) (void *)); int pthread_key_delete(pthread_key_t); -int pthread_mutexattr_init(pthread_mutexattr_t * _Nonnull); -int pthread_mutexattr_destroy(pthread_mutexattr_t * _Nonnull); -int pthread_mutexattr_getpshared( - const pthread_mutexattr_t * _Nonnull, int * _Nonnull); -int pthread_mutexattr_gettype(pthread_mutexattr_t * _Nonnull, - int * _Nonnull); -int pthread_mutexattr_settype(pthread_mutexattr_t * _Nonnull, int); -int pthread_mutexattr_setpshared(pthread_mutexattr_t * _Nonnull, - int); -int pthread_mutex_consistent(pthread_mutex_t * _Nonnull __mutex) +int pthread_mutexattr_init(pthread_mutexattr_t *); +int pthread_mutexattr_destroy(pthread_mutexattr_t *); +int pthread_mutexattr_getpshared(const pthread_mutexattr_t *, + int *); +int pthread_mutexattr_gettype(pthread_mutexattr_t *, int *); +int pthread_mutexattr_settype(pthread_mutexattr_t *, int); +int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int); +int pthread_mutex_consistent(pthread_mutex_t * __mutex) __requires_exclusive(*__mutex); -int pthread_mutex_destroy(pthread_mutex_t * _Nonnull __mutex) +int pthread_mutex_destroy(pthread_mutex_t * __mutex) __requires_unlocked(*__mutex); -int pthread_mutex_init(pthread_mutex_t * _Nonnull __mutex, +int pthread_mutex_init(pthread_mutex_t * __mutex, const pthread_mutexattr_t *) __requires_unlocked(*__mutex); -int pthread_mutex_lock(pthread_mutex_t * _Nonnull __mutex) +int pthread_mutex_lock(pthread_mutex_t * __mutex) __locks_exclusive(*__mutex); -int pthread_mutex_trylock(pthread_mutex_t * _Nonnull __mutex) +int pthread_mutex_trylock(pthread_mutex_t * __mutex) __trylocks_exclusive(0, *__mutex); -int pthread_mutex_timedlock(pthread_mutex_t * _Nonnull __mutex, - const struct timespec * _Nonnull) +int pthread_mutex_timedlock(pthread_mutex_t * __mutex, + const struct timespec *) __trylocks_exclusive(0, *__mutex); -int pthread_mutex_unlock(pthread_mutex_t * _Nonnull __mutex) +int pthread_mutex_unlock(pthread_mutex_t * __mutex) __unlocks(*__mutex); -int pthread_once(pthread_once_t * _Nonnull, - void (* _Nonnull) (void)); -int pthread_rwlock_destroy(pthread_rwlock_t * _Nonnull __rwlock) +int pthread_once(pthread_once_t *, void (*) (void)); +int pthread_rwlock_destroy(pthread_rwlock_t * __rwlock) __requires_unlocked(*__rwlock); -int pthread_rwlock_init(pthread_rwlock_t * _Nonnull __rwlock, +int pthread_rwlock_init(pthread_rwlock_t * __rwlock, const pthread_rwlockattr_t *) __requires_unlocked(*__rwlock); -int pthread_rwlock_rdlock(pthread_rwlock_t * _Nonnull __rwlock) +int pthread_rwlock_rdlock(pthread_rwlock_t * __rwlock) __locks_shared(*__rwlock); -int pthread_rwlock_timedrdlock(pthread_rwlock_t * _Nonnull __rwlock, - const struct timespec * _Nonnull) +int pthread_rwlock_timedrdlock(pthread_rwlock_t * __rwlock, + const struct timespec *) __trylocks_shared(0, *__rwlock); -int pthread_rwlock_timedwrlock(pthread_rwlock_t * _Nonnull __rwlock, - const struct timespec * _Nonnull) +int pthread_rwlock_timedwrlock(pthread_rwlock_t * __rwlock, + const struct timespec *) __trylocks_exclusive(0, *__rwlock); -int pthread_rwlock_tryrdlock(pthread_rwlock_t * _Nonnull __rwlock) +int pthread_rwlock_tryrdlock(pthread_rwlock_t * __rwlock) __trylocks_shared(0, *__rwlock); -int pthread_rwlock_trywrlock(pthread_rwlock_t * _Nonnull __rwlock) +int pthread_rwlock_trywrlock(pthread_rwlock_t * __rwlock) __trylocks_exclusive(0, *__rwlock); -int pthread_rwlock_unlock(pthread_rwlock_t * _Nonnull __rwlock) +int pthread_rwlock_unlock(pthread_rwlock_t * __rwlock) __unlocks(*__rwlock); -int pthread_rwlock_wrlock(pthread_rwlock_t * _Nonnull __rwlock) +int pthread_rwlock_wrlock(pthread_rwlock_t * __rwlock) __locks_exclusive(*__rwlock); -int pthread_rwlockattr_destroy(pthread_rwlockattr_t * _Nonnull); -int pthread_rwlockattr_getkind_np( - const pthread_rwlockattr_t * _Nonnull, int *); -int pthread_rwlockattr_getpshared( - const pthread_rwlockattr_t * _Nonnull, int * _Nonnull); -int pthread_rwlockattr_init(pthread_rwlockattr_t * _Nonnull); -int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t * _Nonnull, +int pthread_rwlockattr_destroy(pthread_rwlockattr_t *); +int pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t *, + int *); +int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *, + int *); +int pthread_rwlockattr_init(pthread_rwlockattr_t *); +int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t *, int); -int pthread_rwlockattr_setpshared(pthread_rwlockattr_t * _Nonnull, - int); +int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *, int); pthread_t pthread_self(void); int pthread_setspecific(pthread_key_t, const void *); -int pthread_spin_init(pthread_spinlock_t * _Nonnull __spin, int) +int pthread_spin_init(pthread_spinlock_t * __spin, int) __requires_unlocked(*__spin); -int pthread_spin_destroy(pthread_spinlock_t * _Nonnull __spin) +int pthread_spin_destroy(pthread_spinlock_t * __spin) __requires_unlocked(*__spin); -int pthread_spin_lock(pthread_spinlock_t * _Nonnull __spin) +int pthread_spin_lock(pthread_spinlock_t * __spin) __locks_exclusive(*__spin); -int pthread_spin_trylock(pthread_spinlock_t * _Nonnull __spin) +int pthread_spin_trylock(pthread_spinlock_t * __spin) __trylocks_exclusive(0, *__spin); -int pthread_spin_unlock(pthread_spinlock_t * _Nonnull __spin) +int pthread_spin_unlock(pthread_spinlock_t * __spin) __unlocks(*__spin); int pthread_cancel(pthread_t); int pthread_setcancelstate(int, int *); @@ -315,27 +302,23 @@ int pthread_mutexattr_getprotocol(pthread_mutexattr_t int pthread_mutexattr_setprotocol(pthread_mutexattr_t *, int); int pthread_mutexattr_getrobust( - pthread_mutexattr_t * _Nonnull __restrict, - int * _Nonnull __restrict); -int pthread_mutexattr_setrobust(pthread_mutexattr_t * _Nonnull, - int); + pthread_mutexattr_t * __restrict, int * __restrict); +int pthread_mutexattr_setrobust(pthread_mutexattr_t *, int); int pthread_attr_getinheritsched(const pthread_attr_t *, int *); -int pthread_attr_getschedparam(const pthread_attr_t * _Nonnull, - struct sched_param * _Nonnull); -int pthread_attr_getschedpolicy(const pthread_attr_t * _Nonnull, - int * _Nonnull); -int pthread_attr_getscope(const pthread_attr_t * _Nonnull, - int * _Nonnull); +int pthread_attr_getschedparam(const pthread_attr_t *, + struct sched_param *); +int pthread_attr_getschedpolicy(const pthread_attr_t *, int *); +int pthread_attr_getscope(const pthread_attr_t *, int *); int pthread_attr_setinheritsched(pthread_attr_t *, int); -int pthread_attr_setschedparam(pthread_attr_t * _Nonnull, - const struct sched_param * _Nonnull); -int pthread_attr_setschedpolicy(pthread_attr_t * _Nonnull, int); -int pthread_attr_setscope(pthread_attr_t * _Nonnull, int); -int pthread_getschedparam(pthread_t pthread, int * _Nonnull, - struct sched_param * _Nonnull); +int pthread_attr_setschedparam(pthread_attr_t *, + const struct sched_param *); +int pthread_attr_setschedpolicy(pthread_attr_t *, int); +int pthread_attr_setscope(pthread_attr_t *, int); +int pthread_getschedparam(pthread_t pthread, int *, + struct sched_param *); int pthread_setschedparam(pthread_t, int, - const struct sched_param * _Nonnull); + const struct sched_param *); #if __XSI_VISIBLE int pthread_getconcurrency(void); int pthread_setconcurrency(int); @@ -345,6 +328,5 @@ void __pthread_cleanup_push_imp(void (*)(void *), voi struct _pthread_cleanup_info *); void __pthread_cleanup_pop_imp(int); __END_DECLS -__NULLABILITY_PRAGMA_POP #endif /* !_PTHREAD_H_ */ From owner-svn-src-stable@freebsd.org Mon Apr 9 01:02:33 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02795F91C5D; Mon, 9 Apr 2018 01:02:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AB2A8879CB; Mon, 9 Apr 2018 01:02:32 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A60DF17B17; Mon, 9 Apr 2018 01:02:32 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3912WKq060424; Mon, 9 Apr 2018 01:02:32 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3912W7o060423; Mon, 9 Apr 2018 01:02:32 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804090102.w3912W7o060423@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 9 Apr 2018 01:02:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332313 - stable/11/share/mk X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/share/mk X-SVN-Commit-Revision: 332313 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 01:02:33 -0000 Author: kevans Date: Mon Apr 9 01:02:32 2018 New Revision: 332313 URL: https://svnweb.freebsd.org/changeset/base/332313 Log: MFC r332146: Re-sort LOADER options Modified: stable/11/share/mk/src.opts.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/share/mk/src.opts.mk ============================================================================== --- stable/11/share/mk/src.opts.mk Mon Apr 9 00:38:24 2018 (r332312) +++ stable/11/share/mk/src.opts.mk Mon Apr 9 01:02:32 2018 (r332313) @@ -126,13 +126,13 @@ __DEFAULT_YES_OPTIONS = \ LIBPTHREAD \ LIBTHR \ LOADER_GELI \ + LOADER_OFW \ + LOADER_UBOOT \ LOCALES \ LOCATE \ LPR \ LS_COLORS \ LZMA_SUPPORT \ - LOADER_OFW \ - LOADER_UBOOT \ MAIL \ MAILWRAPPER \ MAKE \ From owner-svn-src-stable@freebsd.org Mon Apr 9 01:06:09 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3A2EF92067; Mon, 9 Apr 2018 01:06:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7624B69A2C; Mon, 9 Apr 2018 01:06:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6E41517B1D; Mon, 9 Apr 2018 01:06:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w39169YM060604; Mon, 9 Apr 2018 01:06:09 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w391692u060603; Mon, 9 Apr 2018 01:06:09 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804090106.w391692u060603@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 9 Apr 2018 01:06:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332314 - stable/11/sys/i386/i386 X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/i386/i386 X-SVN-Commit-Revision: 332314 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 01:06:09 -0000 Author: emaste Date: Mon Apr 9 01:06:09 2018 New Revision: 332314 URL: https://svnweb.freebsd.org/changeset/base/332314 Log: MFC r331053: ANSIfy i386/vm86.c Modified: stable/11/sys/i386/i386/vm86.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/i386/i386/vm86.c ============================================================================== --- stable/11/sys/i386/i386/vm86.c Mon Apr 9 01:02:32 2018 (r332313) +++ stable/11/sys/i386/i386/vm86.c Mon Apr 9 01:06:09 2018 (r332314) @@ -128,8 +128,7 @@ POPL(struct vm86frame *vmf) } int -vm86_emulate(vmf) - struct vm86frame *vmf; +vm86_emulate(struct vm86frame *vmf) { struct vm86_kernel *vm86; caddr_t addr; @@ -586,10 +585,7 @@ vm86_intcall(int intnum, struct vm86frame *vmf) * caller's cs:ip routine. */ int -vm86_datacall(intnum, vmf, vmc) - int intnum; - struct vm86frame *vmf; - struct vm86context *vmc; +vm86_datacall(int intnum, struct vm86frame *vmf, struct vm86context *vmc) { pt_entry_t *pte = (pt_entry_t *)vm86paddr; vm_paddr_t page; @@ -634,11 +630,8 @@ vm86_getaddr(struct vm86context *vmc, u_short sel, u_s } int -vm86_getptr(vmc, kva, sel, off) - struct vm86context *vmc; - vm_offset_t kva; - u_short *sel; - u_short *off; +vm86_getptr(struct vm86context *vmc, vm_offset_t kva, u_short *sel, + u_short *off) { int i; @@ -653,9 +646,7 @@ vm86_getptr(vmc, kva, sel, off) } int -vm86_sysarch(td, args) - struct thread *td; - char *args; +vm86_sysarch(struct thread *td, char *args) { int error = 0; struct i386_vm86_args ua; From owner-svn-src-stable@freebsd.org Mon Apr 9 01:07:49 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DD69F92239; Mon, 9 Apr 2018 01:07:49 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B53246A921; Mon, 9 Apr 2018 01:07:48 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB90717B21; Mon, 9 Apr 2018 01:07:48 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3917moY060716; Mon, 9 Apr 2018 01:07:48 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3917mcW060711; Mon, 9 Apr 2018 01:07:48 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804090107.w3917mcW060711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 9 Apr 2018 01:07:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332315 - in stable/11/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable/11/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Commit-Revision: 332315 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 01:07:49 -0000 Author: emaste Date: Mon Apr 9 01:07:47 2018 New Revision: 332315 URL: https://svnweb.freebsd.org/changeset/base/332315 Log: MFC r331439: Sort headers in MD Linuxulator files Bring #includes closer to style(9) and reduce differences between the (three) MD versions of linux_machdep.c and linux_sysvec.c. Modified: stable/11/sys/amd64/linux/linux_machdep.c stable/11/sys/amd64/linux/linux_sysvec.c stable/11/sys/amd64/linux32/linux32_machdep.c stable/11/sys/amd64/linux32/linux32_sysvec.c stable/11/sys/i386/linux/linux_machdep.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/linux_machdep.c ============================================================================== --- stable/11/sys/amd64/linux/linux_machdep.c Mon Apr 9 01:06:09 2018 (r332314) +++ stable/11/sys/amd64/linux/linux_machdep.c Mon Apr 9 01:07:47 2018 (r332315) @@ -33,15 +33,14 @@ __FBSDID("$FreeBSD$"); #include -#include -#include #include +#include #include -#include #include +#include #include -#include #include +#include #include #include #include @@ -55,8 +54,9 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include +#include #include #include @@ -72,21 +72,21 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include +#include #include #include #include #include #include -#include +#include #include +#include #include #include #include #include -#include #include Modified: stable/11/sys/amd64/linux/linux_sysvec.c ============================================================================== --- stable/11/sys/amd64/linux/linux_sysvec.c Mon Apr 9 01:06:09 2018 (r332314) +++ stable/11/sys/amd64/linux/linux_sysvec.c Mon Apr 9 01:07:47 2018 (r332315) @@ -53,8 +53,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include +#include #include #include #include Modified: stable/11/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- stable/11/sys/amd64/linux32/linux32_machdep.c Mon Apr 9 01:06:09 2018 (r332314) +++ stable/11/sys/amd64/linux32/linux32_machdep.c Mon Apr 9 01:07:47 2018 (r332315) @@ -34,13 +34,12 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" #include -#include -#include #include -#include -#include #include +#include +#include #include +#include #include #include #include @@ -52,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -61,19 +61,19 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include +#include #include #include #include #include +#include #include #include #include #include #include -#include static void bsd_to_linux_rusage(struct rusage *ru, struct l_rusage *lru); Modified: stable/11/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/11/sys/amd64/linux32/linux32_sysvec.c Mon Apr 9 01:06:09 2018 (r332314) +++ stable/11/sys/amd64/linux32/linux32_sysvec.c Mon Apr 9 01:07:47 2018 (r332315) @@ -54,8 +54,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include +#include #include #include #include Modified: stable/11/sys/i386/linux/linux_machdep.c ============================================================================== --- stable/11/sys/i386/linux/linux_machdep.c Mon Apr 9 01:06:09 2018 (r332314) +++ stable/11/sys/i386/linux/linux_machdep.c Mon Apr 9 01:07:47 2018 (r332315) @@ -30,45 +30,45 @@ __FBSDID("$FreeBSD$"); #include -#include #include -#include #include +#include #include #include #include #include #include -#include #include #include #include #include #include +#include #include #include #include +#include +#include #include #include -#include #include #include #include #include -#include #include +#include #include #include #include +#include #include #include #include #include #include -#include #include /* needed for pcb definition in linux_set_thread_area */ From owner-svn-src-stable@freebsd.org Mon Apr 9 05:43:31 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0F41F82842; Mon, 9 Apr 2018 05:43:30 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 94A137B784; Mon, 9 Apr 2018 05:43:30 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C4511A95D; Mon, 9 Apr 2018 05:43:30 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w395hUNe099739; Mon, 9 Apr 2018 05:43:30 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w395hUAT099738; Mon, 9 Apr 2018 05:43:30 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201804090543.w395hUAT099738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 9 Apr 2018 05:43:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332316 - stable/11/usr.sbin/daemon X-SVN-Group: stable-11 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: stable/11/usr.sbin/daemon X-SVN-Commit-Revision: 332316 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 05:43:31 -0000 Author: gonzo Date: Mon Apr 9 05:43:30 2018 New Revision: 332316 URL: https://svnweb.freebsd.org/changeset/base/332316 Log: MFC r328434 by maxim: o A command line flag for the syslog_facility fixed in the SYNOPSIS. PR: 225441 Modified: stable/11/usr.sbin/daemon/daemon.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/daemon/daemon.8 ============================================================================== --- stable/11/usr.sbin/daemon/daemon.8 Mon Apr 9 01:07:47 2018 (r332315) +++ stable/11/usr.sbin/daemon/daemon.8 Mon Apr 9 05:43:30 2018 (r332316) @@ -43,7 +43,7 @@ .Op Fl o Ar output_file .Op Fl s Ar syslog_priority .Op Fl T Ar syslog_tag -.Op Fl s Ar syslog_facility +.Op Fl l Ar syslog_facility .Ar command arguments ... .Sh DESCRIPTION The From owner-svn-src-stable@freebsd.org Mon Apr 9 08:25:29 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D78B7F8EB01; Mon, 9 Apr 2018 08:25:29 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A5AF745C2; Mon, 9 Apr 2018 08:25:29 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 847FE1C3A2; Mon, 9 Apr 2018 08:25:29 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w398PTqt079355; Mon, 9 Apr 2018 08:25:29 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w398PTFH079353; Mon, 9 Apr 2018 08:25:29 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201804090825.w398PTFH079353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Mon, 9 Apr 2018 08:25:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332318 - in stable/11: . sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: smh X-SVN-Commit-Paths: in stable/11: . sys/net X-SVN-Commit-Revision: 332318 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 08:25:30 -0000 Author: smh Date: Mon Apr 9 08:25:29 2018 New Revision: 332318 URL: https://svnweb.freebsd.org/changeset/base/332318 Log: MFC r327559: Disabled the use of flowid for lagg by default Sponsored by: Multiplay Modified: stable/11/UPDATING stable/11/sys/net/if_lagg.c Directory Properties: stable/11/ (props changed) Modified: stable/11/UPDATING ============================================================================== --- stable/11/UPDATING Mon Apr 9 05:48:12 2018 (r332317) +++ stable/11/UPDATING Mon Apr 9 08:25:29 2018 (r332318) @@ -16,6 +16,14 @@ 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. +20180409: + The use of RSS hash from the network card aka flowid has been + disabled by default for lagg(4) as it's currently incompatible with + the lacp and loadbalance protocols. + + This can be re-enabled by setting the following in loader.conf: + net.link.lagg.default_use_flowid="1" + 20180331: Clang, llvm, lld, lldb, compiler-rt and libc++ have been upgraded to 6.0.0. Please see the 20141231 entry below for information about Modified: stable/11/sys/net/if_lagg.c ============================================================================== --- stable/11/sys/net/if_lagg.c Mon Apr 9 05:48:12 2018 (r332317) +++ stable/11/sys/net/if_lagg.c Mon Apr 9 08:25:29 2018 (r332318) @@ -238,7 +238,7 @@ SYSCTL_INT(_net_link_lagg, OID_AUTO, failover_rx_all, "Accept input from any interface in a failover lagg"); /* Default value for using flowid */ -static VNET_DEFINE(int, def_use_flowid) = 1; +static VNET_DEFINE(int, def_use_flowid) = 0; #define V_def_use_flowid VNET(def_use_flowid) SYSCTL_INT(_net_link_lagg, OID_AUTO, default_use_flowid, CTLFLAG_RWTUN, &VNET_NAME(def_use_flowid), 0, From owner-svn-src-stable@freebsd.org Mon Apr 9 12:53:16 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C757FFA1F87; Mon, 9 Apr 2018 12:53:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 775FC86D34; Mon, 9 Apr 2018 12:53:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 711ED1EF51; Mon, 9 Apr 2018 12:53:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w39CrG6H013967; Mon, 9 Apr 2018 12:53:16 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39CrGZa013963; Mon, 9 Apr 2018 12:53:16 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804091253.w39CrGZa013963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 9 Apr 2018 12:53:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332320 - stable/10/sys/dev/ath X-SVN-Group: stable-10 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/10/sys/dev/ath X-SVN-Commit-Revision: 332320 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 12:53:17 -0000 Author: emaste Date: Mon Apr 9 12:53:15 2018 New Revision: 332320 URL: https://svnweb.freebsd.org/changeset/base/332320 Log: MFC ath(4) potential memory disclosure fixes [1] r327499: ath: fix memory disclosure from ath_btcoex_ioctl The ath_btcoex_ioctl handler allocated a buffer without M_ZERO and returned it to userland without writing to it. The device has permissions only for root so this is not urgent, and the fix can be MFCd and considered for a future EN. [2] r327500: ath: fix possible memory disclosures in ioctl handlers Apply the fix from r327499 to additional ioctl handlers. Note: related fix in r327529 does not apply directly to stable/10 and will be addressed in a followup commit. Submitted by: Domagoj Stolfa [1] Reported by: Ilja van Sprundel [1,2] Reviewed by: adrian [1] Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/dev/ath/if_ath_btcoex.c stable/10/sys/dev/ath/if_ath_lna_div.c stable/10/sys/dev/ath/if_ath_spectral.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ath/if_ath_btcoex.c ============================================================================== --- stable/10/sys/dev/ath/if_ath_btcoex.c Mon Apr 9 09:24:26 2018 (r332319) +++ stable/10/sys/dev/ath/if_ath_btcoex.c Mon Apr 9 12:53:15 2018 (r332320) @@ -321,7 +321,7 @@ ath_btcoex_ioctl(struct ath_softc *sc, struct ath_diag * pointer for us to use below in reclaiming the buffer; * may want to be more defensive. */ - outdata = malloc(outsize, M_TEMP, M_NOWAIT); + outdata = malloc(outsize, M_TEMP, M_NOWAIT | M_ZERO); if (outdata == NULL) { error = ENOMEM; goto bad; @@ -330,6 +330,7 @@ ath_btcoex_ioctl(struct ath_softc *sc, struct ath_diag switch (id) { default: error = EINVAL; + goto bad; } if (outsize < ad->ad_out_size) ad->ad_out_size = outsize; Modified: stable/10/sys/dev/ath/if_ath_lna_div.c ============================================================================== --- stable/10/sys/dev/ath/if_ath_lna_div.c Mon Apr 9 09:24:26 2018 (r332319) +++ stable/10/sys/dev/ath/if_ath_lna_div.c Mon Apr 9 12:53:15 2018 (r332320) @@ -185,7 +185,7 @@ ath_lna_div_ioctl(struct ath_softc *sc, struct ath_dia * pointer for us to use below in reclaiming the buffer; * may want to be more defensive. */ - outdata = malloc(outsize, M_TEMP, M_NOWAIT); + outdata = malloc(outsize, M_TEMP, M_NOWAIT | M_ZERO); if (outdata == NULL) { error = ENOMEM; goto bad; @@ -194,6 +194,7 @@ ath_lna_div_ioctl(struct ath_softc *sc, struct ath_dia switch (id) { default: error = EINVAL; + goto bad; } if (outsize < ad->ad_out_size) ad->ad_out_size = outsize; Modified: stable/10/sys/dev/ath/if_ath_spectral.c ============================================================================== --- stable/10/sys/dev/ath/if_ath_spectral.c Mon Apr 9 09:24:26 2018 (r332319) +++ stable/10/sys/dev/ath/if_ath_spectral.c Mon Apr 9 12:53:15 2018 (r332320) @@ -210,7 +210,7 @@ ath_ioctl_spectral(struct ath_softc *sc, struct ath_di * pointer for us to use below in reclaiming the buffer; * may want to be more defensive. */ - outdata = malloc(outsize, M_TEMP, M_NOWAIT); + outdata = malloc(outsize, M_TEMP, M_NOWAIT | M_ZERO); if (outdata == NULL) { error = ENOMEM; goto bad; @@ -273,6 +273,7 @@ ath_ioctl_spectral(struct ath_softc *sc, struct ath_di break; default: error = EINVAL; + goto bad; } if (outsize < ad->ad_out_size) ad->ad_out_size = outsize; From owner-svn-src-stable@freebsd.org Mon Apr 9 12:55:10 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8931BFA21E1; Mon, 9 Apr 2018 12:55:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3CE9787E02; Mon, 9 Apr 2018 12:55:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3213B1EF52; Mon, 9 Apr 2018 12:55:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w39CtAFo014110; Mon, 9 Apr 2018 12:55:10 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39CtA8L014109; Mon, 9 Apr 2018 12:55:10 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804091255.w39CtA8L014109@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 9 Apr 2018 12:55:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332321 - stable/10/sys/dev/ath X-SVN-Group: stable-10 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/10/sys/dev/ath X-SVN-Commit-Revision: 332321 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 12:55:10 -0000 Author: emaste Date: Mon Apr 9 12:55:09 2018 New Revision: 332321 URL: https://svnweb.freebsd.org/changeset/base/332321 Log: MFC r327529: ath: fix possible memory disclosure in ioctl handler Submitted by: Domagoj Stolfa Modified: stable/10/sys/dev/ath/if_ath.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ath/if_ath.c ============================================================================== --- stable/10/sys/dev/ath/if_ath.c Mon Apr 9 12:53:15 2018 (r332320) +++ stable/10/sys/dev/ath/if_ath.c Mon Apr 9 12:55:09 2018 (r332321) @@ -5910,7 +5910,7 @@ ath_ioctl_diag(struct ath_softc *sc, struct ath_diag * * pointer for us to use below in reclaiming the buffer; * may want to be more defensive. */ - outdata = malloc(outsize, M_TEMP, M_NOWAIT); + outdata = malloc(outsize, M_TEMP, M_NOWAIT | M_ZERO); if (outdata == NULL) { error = ENOMEM; goto bad; From owner-svn-src-stable@freebsd.org Mon Apr 9 12:57:09 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 183F4FA2405; Mon, 9 Apr 2018 12:57:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF5F668F5A; Mon, 9 Apr 2018 12:57:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B4F4E1EF53; Mon, 9 Apr 2018 12:57:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w39Cv88H014242; Mon, 9 Apr 2018 12:57:08 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39Cv8wL014241; Mon, 9 Apr 2018 12:57:08 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804091257.w39Cv8wL014241@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 9 Apr 2018 12:57:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332322 - stable/10/usr.bin/vtfontcvt X-SVN-Group: stable-10 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/10/usr.bin/vtfontcvt X-SVN-Commit-Revision: 332322 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 12:57:09 -0000 Author: emaste Date: Mon Apr 9 12:57:08 2018 New Revision: 332322 URL: https://svnweb.freebsd.org/changeset/base/332322 Log: MFC r331935: vtfontcvt: allow .bdf characters less than full height Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.bin/vtfontcvt/vtfontcvt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- stable/10/usr.bin/vtfontcvt/vtfontcvt.c Mon Apr 9 12:55:09 2018 (r332321) +++ stable/10/usr.bin/vtfontcvt/vtfontcvt.c Mon Apr 9 12:57:08 2018 (r332322) @@ -265,10 +265,23 @@ parse_bdf(FILE *fp, unsigned int map_idx) if (strncmp(ln, "BITMAP", 6) == 0 && (ln[6] == ' ' || ln[6] == '\0')) { + /* + * Assume that the next _height_ lines are bitmap + * data. ENDCHAR is allowed to terminate the bitmap + * early but is not otherwise checked; any extra data + * is ignored. + */ for (i = 0; i < height; i++) { if ((ln = fgetln(fp, &length)) == NULL) errx(1, "Unexpected EOF!\n"); ln[length - 1] = '\0'; + if (strcmp(ln, "ENDCHAR") == 0) { + memset(bytes + i * wbytes, 0, + (height - i) * wbytes); + memset(bytes_r + i * wbytes, 0, + (height - i) * wbytes); + break; + } sscanf(ln, "%x", &line); if (parse_bitmap_line(bytes + i * wbytes, bytes_r + i * wbytes, line, dwidth) != 0) From owner-svn-src-stable@freebsd.org Mon Apr 9 12:58:57 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92889FA25ED; Mon, 9 Apr 2018 12:58:57 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C12B69FD1; Mon, 9 Apr 2018 12:58:54 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E1C1F1EF55; Mon, 9 Apr 2018 12:58:53 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w39Cwro7014350; Mon, 9 Apr 2018 12:58:53 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39Cwr3p014349; Mon, 9 Apr 2018 12:58:53 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804091258.w39Cwr3p014349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 9 Apr 2018 12:58:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332323 - stable/10/usr.bin/vtfontcvt X-SVN-Group: stable-10 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/10/usr.bin/vtfontcvt X-SVN-Commit-Revision: 332323 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 12:58:57 -0000 Author: emaste Date: Mon Apr 9 12:58:53 2018 New Revision: 332323 URL: https://svnweb.freebsd.org/changeset/base/332323 Log: MFC r296920: vtfontcvt: support .hex fonts with chars beyond Unicode BMP This is already supported by the vt(4) vfnt format mapping from code points to glyphs. Update the .hex font parser to accept up to six hex digits. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.bin/vtfontcvt/vtfontcvt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- stable/10/usr.bin/vtfontcvt/vtfontcvt.c Mon Apr 9 12:57:08 2018 (r332322) +++ stable/10/usr.bin/vtfontcvt/vtfontcvt.c Mon Apr 9 12:58:53 2018 (r332323) @@ -328,12 +328,13 @@ parse_hex(FILE *fp, unsigned int map_idx) if (bytes != NULL) errx(1, "malformed input: Width tag after font data"); set_width(atoi(ln + 9)); - } else if (sscanf(ln, "%4x:", &curchar)) { + } else if (sscanf(ln, "%6x:", &curchar)) { if (bytes == NULL) { bytes = xmalloc(wbytes * height); bytes_r = xmalloc(wbytes * height); } - p = ln + 5; + /* ln is guaranteed to have a colon here. */ + p = strchr(ln, ':') + 1; chars_per_row = strlen(p) / height; dwidth = width; if (chars_per_row / 2 > (width + 7) / 8) From owner-svn-src-stable@freebsd.org Mon Apr 9 13:00:03 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6D5AFA270C; Mon, 9 Apr 2018 13:00:03 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 733626AA23; Mon, 9 Apr 2018 13:00:03 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6E15F1EF5A; Mon, 9 Apr 2018 13:00:03 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w39D03Ob014501; Mon, 9 Apr 2018 13:00:03 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39D03eI014500; Mon, 9 Apr 2018 13:00:03 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804091300.w39D03eI014500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 9 Apr 2018 13:00:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332324 - stable/10/usr.bin/vtfontcvt X-SVN-Group: stable-10 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/10/usr.bin/vtfontcvt X-SVN-Commit-Revision: 332324 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 13:00:04 -0000 Author: emaste Date: Mon Apr 9 13:00:03 2018 New Revision: 332324 URL: https://svnweb.freebsd.org/changeset/base/332324 Log: MFC r282920: vtfontcvt: Allow 6 digits in verbose output Some fonts (e.g. GNU Unifont) have more than 100,000 (half-)glyphs. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.bin/vtfontcvt/vtfontcvt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- stable/10/usr.bin/vtfontcvt/vtfontcvt.c Mon Apr 9 12:58:53 2018 (r332323) +++ stable/10/usr.bin/vtfontcvt/vtfontcvt.c Mon Apr 9 13:00:03 2018 (r332324) @@ -513,24 +513,24 @@ print_font_info(void) { printf( "Statistics:\n" -"- glyph_total: %5u\n" -"- glyph_normal: %5u\n" -"- glyph_normal_right: %5u\n" -"- glyph_bold: %5u\n" -"- glyph_bold_right: %5u\n" -"- glyph_unique: %5u\n" -"- glyph_dupe: %5u\n" -"- mapping_total: %5u\n" -"- mapping_normal: %5u\n" -"- mapping_normal_folded: %5u\n" -"- mapping_normal_right: %5u\n" -"- mapping_normal_right_folded: %5u\n" -"- mapping_bold: %5u\n" -"- mapping_bold_folded: %5u\n" -"- mapping_bold_right: %5u\n" -"- mapping_bold_right_folded: %5u\n" -"- mapping_unique: %5u\n" -"- mapping_dupe: %5u\n", +"- glyph_total: %6u\n" +"- glyph_normal: %6u\n" +"- glyph_normal_right: %6u\n" +"- glyph_bold: %6u\n" +"- glyph_bold_right: %6u\n" +"- glyph_unique: %6u\n" +"- glyph_dupe: %6u\n" +"- mapping_total: %6u\n" +"- mapping_normal: %6u\n" +"- mapping_normal_folded: %6u\n" +"- mapping_normal_right: %6u\n" +"- mapping_normal_right_folded: %6u\n" +"- mapping_bold: %6u\n" +"- mapping_bold_folded: %6u\n" +"- mapping_bold_right: %6u\n" +"- mapping_bold_right_folded: %6u\n" +"- mapping_unique: %6u\n" +"- mapping_dupe: %6u\n", glyph_total, glyph_count[0], glyph_count[1], From owner-svn-src-stable@freebsd.org Mon Apr 9 13:01:44 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AB22FA29BB; Mon, 9 Apr 2018 13:01:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B24B66BA39; Mon, 9 Apr 2018 13:01:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD5851EFAE; Mon, 9 Apr 2018 13:01:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w39D1hOO019154; Mon, 9 Apr 2018 13:01:43 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39D1heB019153; Mon, 9 Apr 2018 13:01:43 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804091301.w39D1heB019153@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 9 Apr 2018 13:01:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332325 - stable/10/sys/i386/i386 X-SVN-Group: stable-10 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/10/sys/i386/i386 X-SVN-Commit-Revision: 332325 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 13:01:44 -0000 Author: emaste Date: Mon Apr 9 13:01:43 2018 New Revision: 332325 URL: https://svnweb.freebsd.org/changeset/base/332325 Log: MFC r331053: ANSIfy i386/vm86.c Modified: stable/10/sys/i386/i386/vm86.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/i386/i386/vm86.c ============================================================================== --- stable/10/sys/i386/i386/vm86.c Mon Apr 9 13:00:03 2018 (r332324) +++ stable/10/sys/i386/i386/vm86.c Mon Apr 9 13:01:43 2018 (r332325) @@ -128,8 +128,7 @@ POPL(struct vm86frame *vmf) } int -vm86_emulate(vmf) - struct vm86frame *vmf; +vm86_emulate(struct vm86frame *vmf) { struct vm86_kernel *vm86; caddr_t addr; @@ -586,10 +585,7 @@ vm86_intcall(int intnum, struct vm86frame *vmf) * caller's cs:ip routine. */ int -vm86_datacall(intnum, vmf, vmc) - int intnum; - struct vm86frame *vmf; - struct vm86context *vmc; +vm86_datacall(int intnum, struct vm86frame *vmf, struct vm86context *vmc) { pt_entry_t *pte = (pt_entry_t *)vm86paddr; vm_paddr_t page; @@ -634,11 +630,8 @@ vm86_getaddr(struct vm86context *vmc, u_short sel, u_s } int -vm86_getptr(vmc, kva, sel, off) - struct vm86context *vmc; - vm_offset_t kva; - u_short *sel; - u_short *off; +vm86_getptr(struct vm86context *vmc, vm_offset_t kva, u_short *sel, + u_short *off) { int i; @@ -653,9 +646,7 @@ vm86_getptr(vmc, kva, sel, off) } int -vm86_sysarch(td, args) - struct thread *td; - char *args; +vm86_sysarch(struct thread *td, char *args) { int error = 0; struct i386_vm86_args ua; From owner-svn-src-stable@freebsd.org Mon Apr 9 13:58:52 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19C18F828A1; Mon, 9 Apr 2018 13:58:52 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AED7B6BC34; Mon, 9 Apr 2018 13:58:51 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 5EE1B54CF; Mon, 9 Apr 2018 13:58:51 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Mon, 9 Apr 2018 13:58:49 +0000 From: Glen Barber To: Brooks Davis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r332288 - in stable/11/sys: dev/an dev/ath dev/cxgbe dev/de dev/en dev/fatm dev/hatm dev/if_ndis dev/iwi dev/ixgbe dev/ixl dev/mlx4/mlx4_en dev/mlx5/mlx5_en dev/mwl dev/nxge dev/oce dev... Message-ID: <20180409135849.GA84067@FreeBSD.org> References: <201804081654.w38Gs7JY007779@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="82I3+IH0IqGh5yIs" Content-Disposition: inline In-Reply-To: <201804081654.w38Gs7JY007779@repo.freebsd.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 13:58:52 -0000 --82I3+IH0IqGh5yIs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Apr 08, 2018 at 04:54:07PM +0000, Brooks Davis wrote: > Author: brooks > Date: Sun Apr 8 16:54:07 2018 > New Revision: 332288 > URL: https://svnweb.freebsd.org/changeset/base/332288 >=20 > Log: > MFC r331797: > =20 > Use an accessor function to access ifr_data. > =20 > This fixes 32-bit compat (no ioctl command defintions are required > as struct ifreq is the same size). > =20 > Reviewed by: kib > Obtained from: CheriBSD > Sponsored by: DARPA, AFRL > Differential Revision: https://reviews.freebsd.org/D14900 >=20 > Modified: [...] > stable/11/sys/dev/wl/if_wl.c > Directory Properties: > stable/11/ (props changed) >=20 [...] > Modified: stable/11/sys/dev/wl/if_wl.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/11/sys/dev/wl/if_wl.c Sun Apr 8 16:46:24 2018 (r332287) > +++ stable/11/sys/dev/wl/if_wl.c Sun Apr 8 16:54:07 2018 (r332288) > @@ -1313,7 +1313,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data) > } > WL_UNLOCK(sc); > =20 > - error =3D copyout(psa_buf, ifr->ifr_data, sizeof(psa_buf)); > + error =3D copyout(psa_buf, ifr_data_get_ptr(ifr), sizeof(psa_buf)); > break; > =20 > =20 > @@ -1323,7 +1323,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data) > if ((error =3D priv_check(td, PRIV_DRIVER))) > break; > =20 > - error =3D copyin(ifr->ifr_data, psa_buf, sizeof(psa_buf)); > + error =3D copyin(ifr_data_get_ptr(ifr), psa_buf, sizeof(psa_buf)); > if (error) > break; > =09 > @@ -1357,7 +1357,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data) > /* get the current NWID out of the sc since we stored it there */ > case SIOCGWLCNWID: > WL_LOCK(sc); > - ifr->ifr_data =3D (caddr_t) (sc->nwid[0] << 8 | sc->nwid[1]); > + ifr_data_get_ptr(ifr) =3D (caddr_t) (sc->nwid[0] << 8 | sc->nwid[1]); > WL_UNLOCK(sc); > break; > =20 This part of the change appears to have broken i386 with the following: /usr/src/sys/modules/wl/../../dev/wl/if_wl.c:1360:24: error: expression is= not assignable ifr_data_get_ptr(ifr) =3D (caddr_t) (sc->nwid[0] << 8 | sc->nwid[1= ]); ~~~~~~~~~~~~~~~~~~~~~ ^ 1 error generated. --- if_wl.o --- *** [if_wl.o] Error code 1 make[4]: stopped in /usr/src/sys/modules/wl 1 error Glen --82I3+IH0IqGh5yIs Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEjRJAPC5sqwhs9k2jAxRYpUeP4pMFAlrLcZkACgkQAxRYpUeP 4pNpFRAAgEQj8AQMV+Kdt6xTLxrUejFNBrWsEAWhYrggK5OYyRCSbYcVfxTv8Va1 5q9HsuA/UpCoIAPdZznowhXzdAYUg7+jIo3z401N1Q9Lj2CPKqQZzVN3eyPXYaxk D4XgfeJV2AfrkHB9TvIVNVcfOuPGnDueTk8EYnLSWsQ3lPjh5luSnmPpe+wazZpl 6IAJh2qbECzSJihGd6yp6nXWJz42+q56N2B9Ccg0oUgf8zs7ncPoF5gOFSfDcdCp sGHhOXR9+Y9d1dB2r9eU0KhZYdH3DlY0uG7nFFIwxd3Yd4Mwwd4ubUF3nkpn/y3b qbioQdIFu2pCcnJQt6R4UibVqzOf/DeBwAhBmZfPsckAlWFBbSITRSb9zDHmIJMM PUIO2Mb3yBraAQUfLRCodq4qleUdA1w1mcAy85mp+f+iK6XHYJ42nCiSq/iGy2DO DysR5N7b5TvP/pmbcYBr/qv1oJAZva3w2LZFGB/dEsYTYYmdZLp1zMIROgIBtlO6 F71ECZtMAPIVBFl3evYiMCl9j5lnbkBvAi1HIG4PAhuTu22OjPPTw+7kACwbvcoI 1dI+x8hq1UOj+RM9S383a2K2vBs+D2PveepNQwSqJ+iP1Jp0uqbee+V9hq0cbk9z H6Uey4CX7cBKvjjTtOiNWHkr8OTHEibw8lZ8zyDKvQXQEZ5QfsY= =5Y1d -----END PGP SIGNATURE----- --82I3+IH0IqGh5yIs-- From owner-svn-src-stable@freebsd.org Mon Apr 9 14:04:25 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B66E0F82F97; Mon, 9 Apr 2018 14:04:25 +0000 (UTC) (envelope-from zeising+freebsd@daemonic.se) Received: from mail.daemonic.se (mail.daemonic.se [IPv6:2607:f740:d:20::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 551906EFD8; Mon, 9 Apr 2018 14:04:25 +0000 (UTC) (envelope-from zeising+freebsd@daemonic.se) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 40KX9C6bdNzDhHq; Mon, 9 Apr 2018 14:04:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=daemonic.se; h= content-transfer-encoding:content-language:content-type :content-type:in-reply-to:mime-version:user-agent:date:date :message-id:from:from:references:subject:subject:received :received; s=20151023; t=1523282655; bh=n8t1Xcs5UktdCZjSdPMX8w2B xEeE4ymM4EPHNZnTGMU=; b=JpjRpcxB5N+iWdxKgxrSMhUojvvwtwvKgcl7QW6B 2Pc+7Uc/Zq/L1UvmsXrl73NRFUvDN5lei0cvmmG18hfm2H6uF8CJ/1oXaSumSy3t IeiBBZivOioWUu+OPlym/mHcEWuaLHoJEgO9FX4oCiWEW2XTi6cuek3grmeEw6rF 2XU= X-Virus-Scanned: amavisd-new at daemonic.se Received: from mail.daemonic.se ([IPv6:::1]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256) by cid.daemonic.se (mailscanner.daemonic.se [IPv6:::1]) (amavisd-new, port 10587) with ESMTPS id iIRL8nS-L3xx; Mon, 9 Apr 2018 14:04:15 +0000 (UTC) Received: from garnet.daemonic.se (host-95-192-191-149.mobileonline.telia.com [95.192.191.149]) by mail.daemonic.se (Postfix) with ESMTPSA id 40KX9C0TntzDh2K; Mon, 9 Apr 2018 14:04:15 +0000 (UTC) Subject: Re: svn commit: r331880 - stable/11/etc To: rgrimes@freebsd.org, Kyle Evans Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-11@freebsd.org References: <201804021539.w32FdaID083096@pdx.rh.CN85.dnsmgr.net> From: Niclas Zeising Message-ID: <9cfe34fc-196a-df96-7eaf-036cc4c17bdd@daemonic.se> Date: Mon, 9 Apr 2018 16:04:14 +0200 User-Agent: Mutt/1.5.21 MIME-Version: 1.0 In-Reply-To: <201804021539.w32FdaID083096@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 14:04:25 -0000 On 04/02/18 17:39, Rodney W. Grimes wrote: >> Author: kevans >> Date: Mon Apr 2 15:28:48 2018 >> New Revision: 331880 >> URL: https://svnweb.freebsd.org/changeset/base/331880 >> >> Log: >> MFC r328331: Support configuring arbitrary limits(1) for any rc.conf daemon >> >> Usage is ${name}_limits, and the argument is any flags accepted by >> limits(1), such as `-n 100' (e.g. only allow 100 open files). >> >> Modified: >> stable/11/etc/rc.subr >> Directory Properties: >> stable/11/ (props changed) >> >> Modified: stable/11/etc/rc.subr >> ============================================================================== >> --- stable/11/etc/rc.subr Mon Apr 2 15:07:41 2018 (r331879) >> +++ stable/11/etc/rc.subr Mon Apr 2 15:28:48 2018 (r331880) >> @@ -773,6 +773,8 @@ check_startmsgs() >> # >> # ${name}_login_class n Login class to use, else "daemon". >> # >> +# ${name}_limits n limits(1) to apply to ${command}. >> +# > > Caution, limits(1) is in /usr/bin, this code can fail if used before > /usr is mounted. (Ie, our rc.initdiskless) is probably broken by > this change if a call is made to limits. > > Sorry for jumping on this so late. This is also an issue in CURRENT, and has been since at least 2016. See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206291 Regards -- Niclas From owner-svn-src-stable@freebsd.org Mon Apr 9 14:23:47 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 407D9F843AF; Mon, 9 Apr 2018 14:23:47 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-lf0-f66.google.com (mail-lf0-f66.google.com [209.85.215.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF9C479D3A; Mon, 9 Apr 2018 14:23:46 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-lf0-f66.google.com with SMTP id q9-v6so6835885lfk.9; Mon, 09 Apr 2018 07:23:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=DHvm8bSuojJ4nBAae3KzlSPjh2sCYq3rLhLOOQoqvec=; b=hYy1/aY0zQ1+BZDe3KGUba1BlaXSvlxnApSBK45jcxNBSfIGA0mcstg1IJfmdk/P35 zJ4JrZ5heLV2lx47tmyZLCvg67XfWj6BfIR/VTyPXrHOvHhE/MMP95IAuHehNkjj1OJY 7quxghNEH/HB2csXwyvmDkBtCgvsp4KUImLLNj2NYlDZLDzHaVjExCPJz+Xic/tNZbq8 jincipO4w1ecgcXcVGvIhLeQelyyXP1mmBfptecUedCPkA7SSnNc+01LJpYBNs/NTT22 reJ3C6DLWV6TElQ8SJY2nZZUIvDuz+jvoZfqDWuADOD38or+7ZfTjjBoNIHTT0SVPd/X c2lQ== X-Gm-Message-State: ALQs6tBle1vzIZMDthA4R8ZmUF9kodKfOuhATMiJz9ErLaB3QPiO49Cq Qdg8V2e2UxKBzRYtSzTxhnNjKMmV X-Google-Smtp-Source: AIpwx4+4EWSuK22vXkv0qu/N9tg9mWNba7Cs1alXhrGHLM0O6mmfqzZDtSumA5FMFWUw+GmaHcZa4Q== X-Received: by 2002:a19:1a88:: with SMTP id a130-v6mr15517646lfa.7.1523283463809; Mon, 09 Apr 2018 07:17:43 -0700 (PDT) Received: from mail-lf0-f51.google.com (mail-lf0-f51.google.com. [209.85.215.51]) by smtp.gmail.com with ESMTPSA id q23sm89522ljh.10.2018.04.09.07.17.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Apr 2018 07:17:43 -0700 (PDT) Received: by mail-lf0-f51.google.com with SMTP id q5-v6so6818542lff.12; Mon, 09 Apr 2018 07:17:43 -0700 (PDT) X-Received: by 10.46.148.72 with SMTP id o8mr22873605ljh.74.1523283463543; Mon, 09 Apr 2018 07:17:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.129.90 with HTTP; Mon, 9 Apr 2018 07:17:22 -0700 (PDT) In-Reply-To: <9cfe34fc-196a-df96-7eaf-036cc4c17bdd@daemonic.se> References: <201804021539.w32FdaID083096@pdx.rh.CN85.dnsmgr.net> <9cfe34fc-196a-df96-7eaf-036cc4c17bdd@daemonic.se> From: Kyle Evans Date: Mon, 9 Apr 2018 09:17:22 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r331880 - stable/11/etc To: Niclas Zeising Cc: "Rodney W. Grimes" , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 14:23:47 -0000 On Mon, Apr 9, 2018 at 9:04 AM, Niclas Zeising wrote: > On 04/02/18 17:39, Rodney W. Grimes wrote: >>> >>> Author: kevans >>> Date: Mon Apr 2 15:28:48 2018 >>> New Revision: 331880 >>> URL: https://svnweb.freebsd.org/changeset/base/331880 >>> >>> Log: >>> MFC r328331: Support configuring arbitrary limits(1) for any rc.conf >>> daemon >>> Usage is ${name}_limits, and the argument is any flags accepted by >>> limits(1), such as `-n 100' (e.g. only allow 100 open files). >>> >>> Modified: >>> stable/11/etc/rc.subr >>> Directory Properties: >>> stable/11/ (props changed) >>> >>> Modified: stable/11/etc/rc.subr >>> >>> ============================================================================== >>> --- stable/11/etc/rc.subr Mon Apr 2 15:07:41 2018 (r331879) >>> +++ stable/11/etc/rc.subr Mon Apr 2 15:28:48 2018 (r331880) >>> @@ -773,6 +773,8 @@ check_startmsgs() >>> # >>> # ${name}_login_class n Login class to use, else "daemon". >>> # >>> +# ${name}_limits n limits(1) to apply to ${command}. >>> +# >> >> >> Caution, limits(1) is in /usr/bin, this code can fail if used before >> /usr is mounted. (Ie, our rc.initdiskless) is probably broken by >> this change if a call is made to limits. >> >> > > Sorry for jumping on this so late. This is also an issue in CURRENT, and > has been since at least 2016. > > See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206291 > I kind of like Cy's approach in Comment #7.. scripts that start pretty early, at least, are bound to trip over all kinds of issues. I don't think it's a good idea to work around this in rc.subr like his "relief valve" patch since it'll just create hidden inconsistencies in some of these things. _limits isn't getting applied, but it's not obvious that _limits isn't getting applied because we just silently work around it. Before we know it, we'll be adding something else that's nice in the general case but not applicable for some of these earlier bits. Rod, what are you thoughts on these approaches? From owner-svn-src-stable@freebsd.org Mon Apr 9 14:29:23 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CC78F849E2 for ; Mon, 9 Apr 2018 14:29:23 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-pf0-x22e.google.com (mail-pf0-x22e.google.com [IPv6:2607:f8b0:400e:c00::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C703E7CE40 for ; Mon, 9 Apr 2018 14:29:22 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-pf0-x22e.google.com with SMTP id j2so5844154pff.10 for ; Mon, 09 Apr 2018 07:29:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=vzSUPSfv1UrbfhO4BTkCq2gJBpbWdIxhL62NroYSdRg=; b=di7PkF52fSc7+dv08Ti1N5jddaNZgxuf1QyLjarirrF3FrXM7EGs2iMyfaoyY7i66H wlzA2Y+av0cRx/vDAzrSnq7JaRxzXnTicYM1J41ugXS0EqWww9HshjiDzkrHOmt3wd1z 051RudwBLLOc3ZA2OhjWtOklrjVVixuy8IxcD5q7HhijEcGtajX2aRlPUMpGDYsHJui4 38uj/iB7f1BpkGfEYT6Ov3VPMngmw66DbLH51y3v8yJ2jPrPxq/Xu2X7xJmJ0KOlANkA d96vLnxs+hNkcoOum4hq8RMwd9prh9nBd4awxWbmAhowT+z2upC8DDTjSZIjZNRPTQvj ih8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=vzSUPSfv1UrbfhO4BTkCq2gJBpbWdIxhL62NroYSdRg=; b=JJXdHuBzmuss/gjh4ORloj8ulGl/vzRt4gVH4CWdQWMe0kZRs4QwBgyWk3chMuIm09 iYw3Qa9vsgDzg4VamMrvWSQP9Kzs9ehaxEQFPC/VtrcJ++CtH8fbDNzww0Fa35RCC8vd yYJitaZoOYvLTpUGf/XziO63/LPZC10Lu8oaMGk6W68M4npcf47WRjqlBYvPHnM+i8V6 gMz1Y2mckskYcwc9LicCsXMp6H3lFMvGf59S3rXgnrnyEL+O+s8Bs5wIUULmdkezBkX9 THLBkpSgIDuGn5h8/XM7Eqw++dvc+/wDa4Pags4gVj4dr7BxxleNH8kZGppo/y0FIHFh PG9w== X-Gm-Message-State: ALQs6tCvvNFv+421VfLD2bE9l/lcFcmHSRd4NDVPGoc1KsFrNGBD7q49 sCijpgI2gvXj8nmzK1PVnky31g== X-Google-Smtp-Source: AIpwx4+g2e7DedSn9DCtyCVJzmak/CWkTBnKD91h6/jM2Do8Dsb+pjmIy95XlGinP6IU2cg0RC2KKQ== X-Received: by 10.167.128.207 with SMTP id a15mr21562196pfn.116.1523284161516; Mon, 09 Apr 2018 07:29:21 -0700 (PDT) Received: from mutt-hbsd (abelohost-22.93.217.185.dedicated-ip.abelons.com. [185.217.93.22]) by smtp.gmail.com with ESMTPSA id u7sm1364243pgc.71.2018.04.09.07.29.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Apr 2018 07:29:20 -0700 (PDT) Date: Mon, 9 Apr 2018 10:29:06 -0400 From: Shawn Webb To: Kyle Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r331880 - stable/11/etc Message-ID: <20180409142906.74ohdz4eynugkqw5@mutt-hbsd> References: <201804021528.w32FSmd7023856@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="gyszjjfkqrhzjybb" Content-Disposition: inline In-Reply-To: <201804021528.w32FSmd7023856@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hbsd 12.0-CURRENT FreeBSD 12.0-CURRENT X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20171215 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 14:29:23 -0000 --gyszjjfkqrhzjybb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 02, 2018 at 03:28:48PM +0000, Kyle Evans wrote: > Author: kevans > Date: Mon Apr 2 15:28:48 2018 > New Revision: 331880 > URL: https://svnweb.freebsd.org/changeset/base/331880 >=20 > Log: > MFC r328331: Support configuring arbitrary limits(1) for any rc.conf da= emon > =20 > Usage is ${name}_limits, and the argument is any flags accepted by > limits(1), such as `-n 100' (e.g. only allow 100 open files). A HardenedBSD user has reported an issue with this commit: https://twitter.com/0x666c7578/status/982901931969597440 Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 Tor+XMPP+OTR: lattera@is.a.hacker.sx GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --gyszjjfkqrhzjybb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlrLeK0ACgkQaoRlj1JF bu6V0Q//Qf8xHDDtVOON3pqcBoEvb6eriu1pD9dYrc3jQ3gB9263m5mXjRgcEJec O1mc1/HH3GRyY5NA0Eb9Seuumwxmyi7qlyiz4YShvbFmxFZLhm4WykE0h7m5i2Io Agy2AhB8fELU8QdsRTq2k2FLT1dxJEIDcdkapqg5H0RnetZTePLyQdp4K9B5MClT IQpOEG2IA0r9BpEc1HdK8cL4uULhWAdwFhPNazTZKFjxlE7rolh81s/tiDyfoLip 5l/fFtU2PF3Axw+u/DaD25KYUWQd6qqZyOF0ycFmZi/hgrg1m4Cuh8lhE3dj6nnu aQOpBvAVhQSXY5PuO61gAy7uYe4MdLvCqJ4r55nY9NOdEQzZjlhOGBGyTOeqV3Oh 8WsUETwNlvCjTu9We2FENvsIrkUQebGZ/o+hK5DOSnxhObkWVMUOwcsWoBowWeE8 CYFbE0KQaYzNLpzA9biG3j4wKaM2zO4FPQPt7yTIgoOFiYGk+FdZiuWE59PoCc1i FsrIv9B/zyR+xBHYS7cTu92EiqFegAAbgeIKrgW9Z2akU0Qt4wa6PlmZXMgUBHL8 u3lyH3QxXILArhjm5FNky5tJ8dRB/+Vz9aQPx3ypBg2+obR0RJ7/jHxACr1TuEtG Ws7J0iKgTn3ToYDCGN+AZ2HNAcJM06oz1BLTi1REy85fRmxkgeU= =Zzh7 -----END PGP SIGNATURE----- --gyszjjfkqrhzjybb-- From owner-svn-src-stable@freebsd.org Mon Apr 9 14:36:15 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6013F8517F for ; Mon, 9 Apr 2018 14:36:15 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BD90580CAB for ; Mon, 9 Apr 2018 14:36:14 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-wm0-x233.google.com with SMTP id 66so13323587wmd.3 for ; Mon, 09 Apr 2018 07:36:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=IjeswyJELsWOv3khC7TPOXk/jzxm08WrTG7ZEdBM3Gc=; b=DaNks3h04X3u0lyPYYRlWP+bl0wacF5UXDH/5PVVvvnvwLi2Rk/WB/hOnoSzyZ6w6L r2m/W732+9yc9SE0ypfv0CVBnkg7zY7kmErI2C80E9CDgkqd4q5sBSBGy9TaeAe24llm FZl5CpbFGGL860xsVpaJ0FwnS0W5o+ed3VQcjok9jbIRNGsgODK7SQf+mRuVoH3dJH3a ON8lN0qTTxxFOxH6uK7zPJgmBFfW9jk0ER6PsuDMI92nLklbafqSXLCRe38ZLPG7RkST zEsfe1N+Q23ShNPrX/HyDjm72EYBEY80RyvnQicba25e7ciHtsGaEPGBAB/CDnWrYffv UJgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=IjeswyJELsWOv3khC7TPOXk/jzxm08WrTG7ZEdBM3Gc=; b=r7OYTKNE8Ayc56a0E+Q8vG5NDB76lnYwChcUCal0l+eQxWUQrpxFX98acmSdkIKKvf q6P8p119cEIHMa2GCdy+DBtMYxWlR6FZuPAVN5IOTLQP/HsWCFaM3r7NcVR2J5rfHp0p OAubp9AcIAYaa+vH9/98tSjv3T7RVLzxfcLtLnCpHAoPu6DT2zp+IbFm77knFhflD36M CiDZIRMV15JiJwoLrjE1ANeCE68pjYQ8O6GzcAJEFcTihRq1r/MSOF4An/XstIOQG0a2 WR28/0zlyGCYKDjpYDhg0kFLk52cZFSzdUCBvMBsnCO1NxgMOjQ1nepPGgYXTKrSU2mQ SHNg== X-Gm-Message-State: ALQs6tDvfThj0H9HBMv5kqTwHtjCHRzUUqLwZNkf2j/jnLM96G2CAlF3 MBneNo+z517q90tlmA+jTkRymg== X-Google-Smtp-Source: AIpwx4+JGA/nZkvaBi/NpOHdHqVPasWePb+OCtk3fvZ6AzK1H9VqsEPn31GRZ4vDaq3JvKJhvVN7FA== X-Received: by 10.80.164.182 with SMTP id w51mr22768622edb.152.1523284573338; Mon, 09 Apr 2018 07:36:13 -0700 (PDT) Received: from mutt-hbsd (abelohost-22.93.217.185.dedicated-ip.abelons.com. [185.217.93.22]) by smtp.gmail.com with ESMTPSA id s8sm411254edk.76.2018.04.09.07.36.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Apr 2018 07:36:12 -0700 (PDT) Date: Mon, 9 Apr 2018 10:35:51 -0400 From: Shawn Webb To: Kyle Evans Cc: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r331880 - stable/11/etc Message-ID: <20180409143551.i5uyt75zxe3cdpch@mutt-hbsd> References: <201804021528.w32FSmd7023856@repo.freebsd.org> <20180409142906.74ohdz4eynugkqw5@mutt-hbsd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ohd734bibnkchbxl" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD mutt-hbsd 12.0-CURRENT FreeBSD 12.0-CURRENT X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20171215 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 14:36:16 -0000 --ohd734bibnkchbxl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 09, 2018 at 09:33:38AM -0500, Kyle Evans wrote: > On Mon, Apr 9, 2018 at 9:29 AM, Shawn Webb w= rote: > > On Mon, Apr 02, 2018 at 03:28:48PM +0000, Kyle Evans wrote: > >> Author: kevans > >> Date: Mon Apr 2 15:28:48 2018 > >> New Revision: 331880 > >> URL: https://svnweb.freebsd.org/changeset/base/331880 > >> > >> Log: > >> MFC r328331: Support configuring arbitrary limits(1) for any rc.conf= daemon > >> > >> Usage is ${name}_limits, and the argument is any flags accepted by > >> limits(1), such as `-n 100' (e.g. only allow 100 open files). > > > > A HardenedBSD user has reported an issue with this commit: > > > > https://twitter.com/0x666c7578/status/982901931969597440 > > >=20 > The mariadb ports should be good with this after ports r466451, > tracking PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D227205 Awesome. Thanks! --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 Tor+XMPP+OTR: lattera@is.a.hacker.sx GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --ohd734bibnkchbxl Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlrLekYACgkQaoRlj1JF bu4aLA/+OXXfsJ8qqUHGiO4fqAuvs6PjZle3N/gIvUMQzYFLJNVpRhi02dvcGSHX 3a/1nuyALE2D1dtlv5m3zxRJtVhLn6IiqELce8VGOhbgFtt1bI7Uwk9uHoS+JNk3 0mK12QYP2PJhzjaCQinjiT1B3yvXOWHuA5Iz4PTaF0sV5mAUT2rclXAzRiFhzk9C YktfYCs6Rmzk1zLqN2UeyR/aazoVFIgf2AB/fwz8YWxAc/ZdH/foUUd151yg2wVj DdyH1cdWIdz7xPO11L0247UCSUSy5HtNySgc63tXCw4ewG5WE3PKna6W/sAlB24s 1RN8NdhzKdwsg0g+3ydFh5N9pewNvD/379+xAH+CHGvalBcyxDycpw4jBjwB5si2 RMW3ZXnQKqEQwUD5RtnWIezZ/2ZkXtpW4UbEkAWcKxQdvxH7lUyJ0bTQcGjkqegh bmcg6lhk2GLe05jR2AAZh/M2Bg9OeKElHXC+uZpoR6EFPBv272yqkBxZ8UrubwXS ud2rgqeLfGS5oYkT+8h0CbtD7nJelZlgteWR8fYgRWI8N1MW+7cu96qd0ifoKGCQ dxJv6nBrepMGcHFrJMeTLzxH4HnkrdI1gFkJKF70MQusSY29ICkadjcb/tOadXo9 XotEy289YF2Ig86+YKjkrN43AHLf9WqJkhZo1ew9mqCHOdpCfO4= =ELwC -----END PGP SIGNATURE----- --ohd734bibnkchbxl-- From owner-svn-src-stable@freebsd.org Mon Apr 9 14:46:34 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 347D6F85D21 for ; Mon, 9 Apr 2018 14:46:34 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9AA2886C42; Mon, 9 Apr 2018 14:46:33 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w39EkKmG019018; Mon, 9 Apr 2018 07:46:20 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w39EkKdr019017; Mon, 9 Apr 2018 07:46:20 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804091446.w39EkKdr019017@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r331880 - stable/11/etc In-Reply-To: <9cfe34fc-196a-df96-7eaf-036cc4c17bdd@daemonic.se> To: Niclas Zeising Date: Mon, 9 Apr 2018 07:46:20 -0700 (PDT) CC: rgrimes@freebsd.org, Kyle Evans , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-11@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 14:46:34 -0000 > On 04/02/18 17:39, Rodney W. Grimes wrote: > >> Author: kevans > >> Date: Mon Apr 2 15:28:48 2018 > >> New Revision: 331880 > >> URL: https://svnweb.freebsd.org/changeset/base/331880 > >> > >> Log: > >> MFC r328331: Support configuring arbitrary limits(1) for any rc.conf daemon > >> > >> Usage is ${name}_limits, and the argument is any flags accepted by > >> limits(1), such as `-n 100' (e.g. only allow 100 open files). > >> > >> Modified: > >> stable/11/etc/rc.subr > >> Directory Properties: > >> stable/11/ (props changed) > >> > >> Modified: stable/11/etc/rc.subr > >> ============================================================================== > >> --- stable/11/etc/rc.subr Mon Apr 2 15:07:41 2018 (r331879) > >> +++ stable/11/etc/rc.subr Mon Apr 2 15:28:48 2018 (r331880) > >> @@ -773,6 +773,8 @@ check_startmsgs() > >> # > >> # ${name}_login_class n Login class to use, else "daemon". > >> # > >> +# ${name}_limits n limits(1) to apply to ${command}. > >> +# > > > > Caution, limits(1) is in /usr/bin, this code can fail if used before > > /usr is mounted. (Ie, our rc.initdiskless) is probably broken by > > this change if a call is made to limits. > > > > > > Sorry for jumping on this so late. This is also an issue in CURRENT, > and has been since at least 2016. I was aware that it was an issue and why I made a comment about it being MFC'ed. Though I had forgot a bug report existed. > See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206291 This bug is rat holed as it has no FreeBSD-foo@ in the cc list. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-stable@freebsd.org Mon Apr 9 15:00:43 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97EDCF86C4E; Mon, 9 Apr 2018 15:00:43 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 146DB6E95D; Mon, 9 Apr 2018 15:00:42 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w39F0eN3019073; Mon, 9 Apr 2018 08:00:40 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w39F0dIq019072; Mon, 9 Apr 2018 08:00:39 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804091500.w39F0dIq019072@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r331880 - stable/11/etc In-Reply-To: To: Kyle Evans Date: Mon, 9 Apr 2018 08:00:39 -0700 (PDT) CC: Niclas Zeising , "Rodney W. Grimes" , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , svn-src-stable-11@freebsd.org, dteske@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 15:00:43 -0000 Adding Devin Teske to cc: > On Mon, Apr 9, 2018 at 9:04 AM, Niclas Zeising > wrote: > > On 04/02/18 17:39, Rodney W. Grimes wrote: > >>> > >>> Author: kevans > >>> Date: Mon Apr 2 15:28:48 2018 > >>> New Revision: 331880 > >>> URL: https://svnweb.freebsd.org/changeset/base/331880 > >>> > >>> Log: > >>> MFC r328331: Support configuring arbitrary limits(1) for any rc.conf > >>> daemon > >>> Usage is ${name}_limits, and the argument is any flags accepted by > >>> limits(1), such as `-n 100' (e.g. only allow 100 open files). > >>> > >>> Modified: > >>> stable/11/etc/rc.subr > >>> Directory Properties: > >>> stable/11/ (props changed) > >>> > >>> Modified: stable/11/etc/rc.subr > >>> > >>> ============================================================================== > >>> --- stable/11/etc/rc.subr Mon Apr 2 15:07:41 2018 (r331879) > >>> +++ stable/11/etc/rc.subr Mon Apr 2 15:28:48 2018 (r331880) > >>> @@ -773,6 +773,8 @@ check_startmsgs() > >>> # > >>> # ${name}_login_class n Login class to use, else "daemon". > >>> # > >>> +# ${name}_limits n limits(1) to apply to ${command}. > >>> +# > >> > >> > >> Caution, limits(1) is in /usr/bin, this code can fail if used before > >> /usr is mounted. (Ie, our rc.initdiskless) is probably broken by > >> this change if a call is made to limits. > >> > >> > > > > Sorry for jumping on this so late. This is also an issue in CURRENT, and > > has been since at least 2016. > > > > See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206291 > > > > I kind of like Cy's approach in Comment #7.. scripts that start pretty > early, at least, are bound to trip over all kinds of issues. I think you mean comment #5, with a specific patch to rc.d/ddb in #7? If so I like that approach. > I don't think it's a good idea to work around this in rc.subr like his > "relief valve" patch since it'll just create hidden inconsistencies in > some of these things. _limits isn't getting applied, but it's not > obvious that _limits isn't getting applied because we just silently > work around it. Before we know it, we'll be adding something else > that's nice in the general case but not applicable for some of these > earlier bits. Agree fully with that, changing behavior based on avaliablility of a critical function would be a POLA issue. > Rod, what are you thoughts on these approaches? I am ok with Cy's #5/#7 fix. I would like to look closer at this limits(1) issue, as I do not understand why /etc/rc* suddenly grew the need to start tossing limits on programs in a generic way. Also if a specific user has a specific need to put a limit on a program could that not be done with: program_foo_limits="-C blah blah" foo_program="limits ${program_foo_limits} foo" in /etc/rc.conf or where ever else it is valid to do this. I would also like to ask Devin Teske to weigh in on these issues, so have added them to the CC: of this reply. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-stable@freebsd.org Mon Apr 9 15:01:41 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13F4CF86D24; Mon, 9 Apr 2018 15:01:41 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-lf0-f41.google.com (mail-lf0-f41.google.com [209.85.215.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7338C6F2C7; Mon, 9 Apr 2018 15:01:40 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-lf0-f41.google.com with SMTP id j20-v6so7048509lfk.2; Mon, 09 Apr 2018 08:01:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=EsbbcdfpoboM9UAp9VJ/39H7uKzH5FQSUqR5l+l+MuY=; b=N0CNpypBuGgCg6g1v3eZpia0uhEKOBb/s6jDwD4C+tfUnXACoAxfAFssR5AtLq/HZP i87fC/KQUz8YhCLtfgPcwC6d/RxBk1NpPoq4le5gwFRM8+dtqhqrn9cY7oFtqZW6MlBG /TBVVLpsVGJpIr5T5M8XEwUcJr4pQ802QrQDWnFCdB4jG1Mw8sclyGKxFanq2BWwVaxf EjKVfk0xiWI/84p/0hrLPjN8JBVaDJFQKmMnxi9boq41DQz0ZvDQIJNoMxR5XL+u662j 2bVYuKSUaKNuSl2YQ0/ebgdQ9jpKusp4enErTed+BL31PzR5lHQv9R6Cp8mHndvucfPr 2WmQ== X-Gm-Message-State: ALQs6tB2g7jYYGuFw1tUhxSgbgnM3fB8xtsO13sDjCssdvKNvB4MjhD1 asCw/ZCrfJqKASChHWvyUVzZrqgx X-Google-Smtp-Source: AIpwx48fxevyK97vlp5oUqAJM+ISLsxOaATkuwFv/M9rUUwvVLp/x4of8kMY/KxZiLOPKMNHZO7T6Q== X-Received: by 2002:a19:511d:: with SMTP id f29-v6mr22014707lfb.39.1523285754323; Mon, 09 Apr 2018 07:55:54 -0700 (PDT) Received: from mail-lf0-f53.google.com (mail-lf0-f53.google.com. [209.85.215.53]) by smtp.gmail.com with ESMTPSA id g22sm100318lje.36.2018.04.09.07.55.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Apr 2018 07:55:54 -0700 (PDT) Received: by mail-lf0-f53.google.com with SMTP id c78-v6so7008465lfh.1; Mon, 09 Apr 2018 07:55:54 -0700 (PDT) X-Received: by 10.46.128.132 with SMTP id i4mr22397396ljg.51.1523285753944; Mon, 09 Apr 2018 07:55:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.129.90 with HTTP; Mon, 9 Apr 2018 07:55:33 -0700 (PDT) In-Reply-To: <201804091446.w39EkKdr019017@pdx.rh.CN85.dnsmgr.net> References: <9cfe34fc-196a-df96-7eaf-036cc4c17bdd@daemonic.se> <201804091446.w39EkKdr019017@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Mon, 9 Apr 2018 09:55:33 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r331880 - stable/11/etc To: "Rodney W. Grimes" Cc: Niclas Zeising , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 15:01:41 -0000 On Mon, Apr 9, 2018 at 9:46 AM, Rodney W. Grimes wrote: >> On 04/02/18 17:39, Rodney W. Grimes wrote: >> >> Author: kevans >> >> Date: Mon Apr 2 15:28:48 2018 >> >> New Revision: 331880 >> >> URL: https://svnweb.freebsd.org/changeset/base/331880 >> >> >> >> Log: >> >> MFC r328331: Support configuring arbitrary limits(1) for any rc.conf daemon >> >> >> >> Usage is ${name}_limits, and the argument is any flags accepted by >> >> limits(1), such as `-n 100' (e.g. only allow 100 open files). >> >> >> >> Modified: >> >> stable/11/etc/rc.subr >> >> Directory Properties: >> >> stable/11/ (props changed) >> >> >> >> Modified: stable/11/etc/rc.subr >> >> ============================================================================== >> >> --- stable/11/etc/rc.subr Mon Apr 2 15:07:41 2018 (r331879) >> >> +++ stable/11/etc/rc.subr Mon Apr 2 15:28:48 2018 (r331880) >> >> @@ -773,6 +773,8 @@ check_startmsgs() >> >> # >> >> # ${name}_login_class n Login class to use, else "daemon". >> >> # >> >> +# ${name}_limits n limits(1) to apply to ${command}. >> >> +# >> > >> > Caution, limits(1) is in /usr/bin, this code can fail if used before >> > /usr is mounted. (Ie, our rc.initdiskless) is probably broken by >> > this change if a call is made to limits. >> > >> > >> >> Sorry for jumping on this so late. This is also an issue in CURRENT, >> and has been since at least 2016. > > I was aware that it was an issue and why I made a comment about it > being MFC'ed. Though I had forgot a bug report existed. I'm kind of surprised we haven't had more complaints about this- the original commit for this stuff landed before stable/11 was even branched, so it's been broken for all of 11.x's lifetime. >> See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206291 > > This bug is rat holed as it has no FreeBSD-foo@ in the cc list. > > > -- > Rod Grimes rgrimes@freebsd.org > From owner-svn-src-stable@freebsd.org Mon Apr 9 15:09:04 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32BCEF87625; Mon, 9 Apr 2018 15:09:04 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6203735D0; Mon, 9 Apr 2018 15:09:03 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w39F91r7019102; Mon, 9 Apr 2018 08:09:01 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w39F91lw019101; Mon, 9 Apr 2018 08:09:01 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804091509.w39F91lw019101@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r331880 - stable/11/etc In-Reply-To: <20180409143551.i5uyt75zxe3cdpch@mutt-hbsd> To: Shawn Webb Date: Mon, 9 Apr 2018 08:09:01 -0700 (PDT) CC: Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org, dteske@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 15:09:04 -0000 -- Start of PGP signed section. > On Mon, Apr 09, 2018 at 09:33:38AM -0500, Kyle Evans wrote: > > On Mon, Apr 9, 2018 at 9:29 AM, Shawn Webb wrote: > > > On Mon, Apr 02, 2018 at 03:28:48PM +0000, Kyle Evans wrote: > > >> Author: kevans > > >> Date: Mon Apr 2 15:28:48 2018 > > >> New Revision: 331880 > > >> URL: https://svnweb.freebsd.org/changeset/base/331880 > > >> > > >> Log: > > >> MFC r328331: Support configuring arbitrary limits(1) for any rc.conf daemon > > >> > > >> Usage is ${name}_limits, and the argument is any flags accepted by > > >> limits(1), such as `-n 100' (e.g. only allow 100 open files). > > > > > > A HardenedBSD user has reported an issue with this commit: > > > > > > https://twitter.com/0x666c7578/status/982901931969597440 > > > > > > > The mariadb ports should be good with this after ports r466451, > > tracking PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227205 > > Awesome. Thanks! Maybe not so awesome, as now if we go trying to fix the earlier issues it also now effects a pile of ports... *sigh*. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-stable@freebsd.org Mon Apr 9 15:11:17 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA9D4F878A4; Mon, 9 Apr 2018 15:11:17 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5CAF374A6D; Mon, 9 Apr 2018 15:11:17 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 53341204BA; Mon, 9 Apr 2018 15:11:17 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w39FBHfI082568; Mon, 9 Apr 2018 15:11:17 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39FBHOe082550; Mon, 9 Apr 2018 15:11:17 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201804091511.w39FBHOe082550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Mon, 9 Apr 2018 15:11:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332328 - stable/11/sys/netpfil/pf X-SVN-Group: stable-11 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/11/sys/netpfil/pf X-SVN-Commit-Revision: 332328 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 15:11:17 -0000 Author: kp Date: Mon Apr 9 15:11:17 2018 New Revision: 332328 URL: https://svnweb.freebsd.org/changeset/base/332328 Log: MFC r331225: pf: Fix memory leak in DIOCRADDTABLES If a user attempts to add two tables with the same name the duplicate table will not be added, but we forgot to free the duplicate table, leaking memory. Ensure we free the duplicate table in the error path. Reported by: Coverity CID: 1382111 Modified: stable/11/sys/netpfil/pf/pf_table.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/pf/pf_table.c ============================================================================== --- stable/11/sys/netpfil/pf/pf_table.c Mon Apr 9 14:05:43 2018 (r332327) +++ stable/11/sys/netpfil/pf/pf_table.c Mon Apr 9 15:11:17 2018 (r332328) @@ -1124,8 +1124,10 @@ pfr_add_tables(struct pfr_table *tbl, int size, int *n if (p == NULL) senderr(ENOMEM); SLIST_FOREACH(q, &addq, pfrkt_workq) { - if (!pfr_ktable_compare(p, q)) + if (!pfr_ktable_compare(p, q)) { + pfr_destroy_ktable(p, 0); goto _skip; + } } SLIST_INSERT_HEAD(&addq, p, pfrkt_workq); xadd++; From owner-svn-src-stable@freebsd.org Mon Apr 9 15:11:46 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50091F87A73 for ; Mon, 9 Apr 2018 15:11:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22c.google.com (mail-it0-x22c.google.com [IPv6:2607:f8b0:4001:c0b::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D6EBF74F6E for ; Mon, 9 Apr 2018 15:11:45 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22c.google.com with SMTP id t192-v6so12006056itc.1 for ; Mon, 09 Apr 2018 08:11:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=IcgP45LvsA0dxyeA0F5EW1p0Yr7dianjX+d4V6ZrOmw=; b=l/crAJKOKejT228zU2mnz4qwfgtJGLXfWQlFmu4LQKFeXSdTjiZG6/QOlFc+ph6nPU d8X13eZtO5DhDSqg1KwSrPF/+GkwFAxQe09x3tenR3lVkoJqgEWOwHdTa3dg6gmuMhWf cCQpVZnzsH2e1M6gTGjGNDickGt/dMx2ww+qATptKX+MDbfHy+KkUw27Qo2yPuehrk2U fT0bT/a3e8WLV0wk5pFFfcgvvG8JUk6aHi0RYKCcxa3wvPZPNDdGhzM5BEqMl15rw4gy shdcVKpLfKQE5Sos63SGfZJAMfttlw+qk1CtR7ZomC2a6yCVXHyC/NCeDln/jYruVOhJ B/ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=IcgP45LvsA0dxyeA0F5EW1p0Yr7dianjX+d4V6ZrOmw=; b=BkRxxJ/BK4/9QmA00G/qGMOA2aYjuqz1e9BBs+75iBQFgv3ujxTs3P8jiB5HR6ROQf U10l5WOlsvO6JGTzo0NeTT2MoZMD7E533XBuy7bi2YGcCtKbS+TDpXvDr3dqQitR/7J4 LV6RXbQyEyAva81kbaJuDY6C7EwhZZ8GbeZrb7POpxzHjBvTSJFicWG2lhncN6iVW4ib GmAoXs+7D/5+fDgo87SL4qTe2cNPHZ5JViW3Air8fDQvOV4FxvjITpPqMA+gXZcJGzsj t7EjtK/ZSElG01JyB9fMiiFari3+88370bqY9CRJt9qc8uK0LDyxIeS0ejw/vFBmQnPy 5aZw== X-Gm-Message-State: ALQs6tCzsZrzuPYPi48k6IYDdjM0hbXPItHDX5aqE5yA8E8PvQy/l9Jv cnCnhqQqZ2ZomRbguQOiu/Y+Wpy8phjwIPih9Mut+w== X-Google-Smtp-Source: AIpwx48G8UifDIiCumYNYZnEkbHmI6nfkad4PBC1hfaTOKv6c8meWpAFX8pnQiO71Q2Cxm0qRBkPRjcRzMiBw5TEdUU= X-Received: by 2002:a24:1fc7:: with SMTP id d190-v6mr414606itd.57.1523286704589; Mon, 09 Apr 2018 08:11:44 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.228.135 with HTTP; Mon, 9 Apr 2018 08:11:44 -0700 (PDT) X-Originating-IP: [50.227.106.226] In-Reply-To: <20180409135849.GA84067@FreeBSD.org> References: <201804081654.w38Gs7JY007779@repo.freebsd.org> <20180409135849.GA84067@FreeBSD.org> From: Warner Losh Date: Mon, 9 Apr 2018 09:11:44 -0600 X-Google-Sender-Auth: PfZDE9aWdWQF_Hg9Ef2QAAxScP0 Message-ID: Subject: Re: svn commit: r332288 - in stable/11/sys: dev/an dev/ath dev/cxgbe dev/de dev/en dev/fatm dev/hatm dev/if_ndis dev/iwi dev/ixgbe dev/ixl dev/mlx4/mlx4_en dev/mlx5/mlx5_en dev/mwl dev/nxge dev/oce dev... To: Glen Barber Cc: Brooks Davis , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 15:11:46 -0000 On Mon, Apr 9, 2018 at 7:58 AM, Glen Barber wrote: > On Sun, Apr 08, 2018 at 04:54:07PM +0000, Brooks Davis wrote: > > Author: brooks > > Date: Sun Apr 8 16:54:07 2018 > > New Revision: 332288 > > URL: https://svnweb.freebsd.org/changeset/base/332288 > > > > Log: > > MFC r331797: > > > > Use an accessor function to access ifr_data. > > > > This fixes 32-bit compat (no ioctl command defintions are required > > as struct ifreq is the same size). > > > > Reviewed by: kib > > Obtained from: CheriBSD > > Sponsored by: DARPA, AFRL > > Differential Revision: https://reviews.freebsd.org/D14900 > > > > Modified: > [...] > > stable/11/sys/dev/wl/if_wl.c > > > Directory Properties: > > stable/11/ (props changed) > > > [...] > > Modified: stable/11/sys/dev/wl/if_wl.c > > ============================================================ > ================== > > --- stable/11/sys/dev/wl/if_wl.c Sun Apr 8 16:46:24 2018 > (r332287) > > +++ stable/11/sys/dev/wl/if_wl.c Sun Apr 8 16:54:07 2018 > (r332288) > > @@ -1313,7 +1313,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t > data) > > } > > WL_UNLOCK(sc); > > > > - error = copyout(psa_buf, ifr->ifr_data, sizeof(psa_buf)); > > + error = copyout(psa_buf, ifr_data_get_ptr(ifr), sizeof(psa_buf)); > > break; > > > > > > @@ -1323,7 +1323,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t > data) > > if ((error = priv_check(td, PRIV_DRIVER))) > > break; > > > > - error = copyin(ifr->ifr_data, psa_buf, sizeof(psa_buf)); > > + error = copyin(ifr_data_get_ptr(ifr), psa_buf, sizeof(psa_buf)); > > if (error) > > break; > > > > @@ -1357,7 +1357,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t > data) > > /* get the current NWID out of the sc since we stored it there */ > > case SIOCGWLCNWID: > > WL_LOCK(sc); > > - ifr->ifr_data = (caddr_t) (sc->nwid[0] << 8 | sc->nwid[1]); > > + ifr_data_get_ptr(ifr) = (caddr_t) (sc->nwid[0] << 8 | sc->nwid[1]); > > WL_UNLOCK(sc); > > break; > > > > This part of the change appears to have broken i386 with the following: > > /usr/src/sys/modules/wl/../../dev/wl/if_wl.c:1360:24: error: expression > is not assignable > ifr_data_get_ptr(ifr) = (caddr_t) (sc->nwid[0] << 8 | > sc->nwid[1]); > ~~~~~~~~~~~~~~~~~~~~~ ^ > 1 error generated. > --- if_wl.o --- > *** [if_wl.o] Error code 1 > > make[4]: stopped in /usr/src/sys/modules/wl > 1 error > wl has been removed in -current. It's pre-802.11 ISA card with thin market penetration. I would be shocked if anybody has run this on a FreeBSD system > 4.x. Warner From owner-svn-src-stable@freebsd.org Mon Apr 9 15:14:32 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AF6FF87DC8 for ; Mon, 9 Apr 2018 15:14:32 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2CA076A58; Mon, 9 Apr 2018 15:14:31 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w39FEPev019141; Mon, 9 Apr 2018 08:14:25 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w39FEPRv019139; Mon, 9 Apr 2018 08:14:25 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804091514.w39FEPRv019139@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r331880 - stable/11/etc In-Reply-To: To: Kyle Evans Date: Mon, 9 Apr 2018 08:14:25 -0700 (PDT) CC: "Rodney W. Grimes" , Niclas Zeising , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , svn-src-stable-11@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 15:14:32 -0000 [ Charset UTF-8 unsupported, converting... ] > On Mon, Apr 9, 2018 at 9:46 AM, Rodney W. Grimes > wrote: > >> On 04/02/18 17:39, Rodney W. Grimes wrote: > >> >> Author: kevans > >> >> Date: Mon Apr 2 15:28:48 2018 > >> >> New Revision: 331880 > >> >> URL: https://svnweb.freebsd.org/changeset/base/331880 > >> >> > >> >> Log: > >> >> MFC r328331: Support configuring arbitrary limits(1) for any rc.conf daemon > >> >> > >> >> Usage is ${name}_limits, and the argument is any flags accepted by > >> >> limits(1), such as `-n 100' (e.g. only allow 100 open files). > >> >> > >> >> Modified: > >> >> stable/11/etc/rc.subr > >> >> Directory Properties: > >> >> stable/11/ (props changed) > >> >> > >> >> Modified: stable/11/etc/rc.subr > >> >> ============================================================================== > >> >> --- stable/11/etc/rc.subr Mon Apr 2 15:07:41 2018 (r331879) > >> >> +++ stable/11/etc/rc.subr Mon Apr 2 15:28:48 2018 (r331880) > >> >> @@ -773,6 +773,8 @@ check_startmsgs() > >> >> # > >> >> # ${name}_login_class n Login class to use, else "daemon". > >> >> # > >> >> +# ${name}_limits n limits(1) to apply to ${command}. > >> >> +# > >> > > >> > Caution, limits(1) is in /usr/bin, this code can fail if used before > >> > /usr is mounted. (Ie, our rc.initdiskless) is probably broken by > >> > this change if a call is made to limits. > >> > > >> > > >> > >> Sorry for jumping on this so late. This is also an issue in CURRENT, > >> and has been since at least 2016. > > > > I was aware that it was an issue and why I made a comment about it > > being MFC'ed. Though I had forgot a bug report existed. > > I'm kind of surprised we haven't had more complaints about this- the > original commit for this stuff landed before stable/11 was even > branched, so it's been broken for all of 11.x's lifetime. History has taught me it takes a long time for this type of breakage to usually surface in a noticable way. Also I think until you merged this last ${name}_limits thing it actually didn't cause an issue, except for the few like me running diskless systems and or seperate /usr. This latest issue is a name space collision between base and ports. People who see limits issues due to missing /usr files usually know how to work around it, and they do, they just cp /usr/bin/limits to /bin, and do not submit a bug report or send an email. > >> See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206291 > > > > This bug is rat holed as it has no FreeBSD-foo@ in the cc list. > > > > > > -- > > Rod Grimes rgrimes@freebsd.org > > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-stable@freebsd.org Mon Apr 9 15:19:05 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA1B0F88232; Mon, 9 Apr 2018 15:19:04 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-lf0-f46.google.com (mail-lf0-f46.google.com [209.85.215.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478CD79370; Mon, 9 Apr 2018 15:19:04 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-lf0-f46.google.com with SMTP id v207-v6so7130537lfa.10; Mon, 09 Apr 2018 08:19:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=30g27/wpeTpHfBYaLd2HMQVMSQ7oQOvmsWp5vEUCArg=; b=FU8OWa/7PdQK9StUIAt6J0IfIfdTp3uj+bzBBMOsSbpGG5AWdjvVygLNgss+unZMo+ 9AKKO8SfV0un9AMRuEO4mb0mMeycgBlrjwRXZ+dwPpuAL1Ye4TBpqWM5QaRYQKqIcFF7 rjqBAkTYwubmhR/u/qg8B/o3kIL3hQLJIHD26yN6H+3yQdS3y9G3RNtICio03OJJsYQr VcnNghW3KktXJizawRgSPJs25Yq11YoVuDAvSuFPCwpCCECiYumXMm3jiBw6tVZRUNR2 xMpx9qCtvqPK7FZguK29ZQyZl6NoH7/ipKxKc/30SmC8hYUHeBnyP117mED+nRr2Bl+y nevQ== X-Gm-Message-State: ALQs6tCEbuHwN+PGQ3Q7FIsnYnCHaRcx76e/HQ8IuQhGRMYxp6WIpRF9 Uo5QIoblDkAfkuk5X1hrmGD7RE7K X-Google-Smtp-Source: AIpwx48O8KFmZQMagSk83kJM8DVi6MnYfYFBY0ZwuprpOqlygOmOPw7oOm8yntXWCKzEcxW13W6ZeA== X-Received: by 10.46.135.134 with SMTP id n6mr23334599lji.52.1523287136763; Mon, 09 Apr 2018 08:18:56 -0700 (PDT) Received: from mail-lf0-f52.google.com (mail-lf0-f52.google.com. [209.85.215.52]) by smtp.gmail.com with ESMTPSA id m127-v6sm118096lfm.79.2018.04.09.08.18.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Apr 2018 08:18:56 -0700 (PDT) Received: by mail-lf0-f52.google.com with SMTP id m200-v6so7135570lfm.4; Mon, 09 Apr 2018 08:18:56 -0700 (PDT) X-Received: by 10.46.91.21 with SMTP id p21mr23629606ljb.38.1523287136434; Mon, 09 Apr 2018 08:18:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.129.90 with HTTP; Mon, 9 Apr 2018 08:18:35 -0700 (PDT) In-Reply-To: <201804091514.w39FEPRv019139@pdx.rh.CN85.dnsmgr.net> References: <201804091514.w39FEPRv019139@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Mon, 9 Apr 2018 10:18:35 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r331880 - stable/11/etc To: "Rodney W. Grimes" Cc: Kyle Evans , Niclas Zeising , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 15:19:05 -0000 On Mon, Apr 9, 2018 at 10:14 AM, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] >> On Mon, Apr 9, 2018 at 9:46 AM, Rodney W. Grimes >> wrote: >> >> On 04/02/18 17:39, Rodney W. Grimes wrote: >> >> >> Author: kevans >> >> >> Date: Mon Apr 2 15:28:48 2018 >> >> >> New Revision: 331880 >> >> >> URL: https://svnweb.freebsd.org/changeset/base/331880 >> >> >> >> >> >> Log: >> >> >> MFC r328331: Support configuring arbitrary limits(1) for any rc.conf daemon >> >> >> >> >> >> Usage is ${name}_limits, and the argument is any flags accepted by >> >> >> limits(1), such as `-n 100' (e.g. only allow 100 open files). >> >> >> >> >> >> Modified: >> >> >> stable/11/etc/rc.subr >> >> >> Directory Properties: >> >> >> stable/11/ (props changed) >> >> >> >> >> >> Modified: stable/11/etc/rc.subr >> >> >> ============================================================================== >> >> >> --- stable/11/etc/rc.subr Mon Apr 2 15:07:41 2018 (r331879) >> >> >> +++ stable/11/etc/rc.subr Mon Apr 2 15:28:48 2018 (r331880) >> >> >> @@ -773,6 +773,8 @@ check_startmsgs() >> >> >> # >> >> >> # ${name}_login_class n Login class to use, else "daemon". >> >> >> # >> >> >> +# ${name}_limits n limits(1) to apply to ${command}. >> >> >> +# >> >> > >> >> > Caution, limits(1) is in /usr/bin, this code can fail if used before >> >> > /usr is mounted. (Ie, our rc.initdiskless) is probably broken by >> >> > this change if a call is made to limits. >> >> > >> >> > >> >> >> >> Sorry for jumping on this so late. This is also an issue in CURRENT, >> >> and has been since at least 2016. >> > >> > I was aware that it was an issue and why I made a comment about it >> > being MFC'ed. Though I had forgot a bug report existed. >> >> I'm kind of surprised we haven't had more complaints about this- the >> original commit for this stuff landed before stable/11 was even >> branched, so it's been broken for all of 11.x's lifetime. > > History has taught me it takes a long time for this type of > breakage to usually surface in a noticable way. Also I think > until you merged this last ${name}_limits thing it actually > didn't cause an issue, except for the few like me running > diskless systems and or seperate /usr. I don't see how this merge could possibly have been the cause of any claimed issues- like I said before, it didn't add any limits invocations, it added an arg to the limits invocation that already existed. You can see this pretty clearly from the diff, we didn't even change any conditions for limits to be invoked. > > This latest issue is a name space collision between base and ports. > > People who see limits issues due to missing /usr files usually > know how to work around it, and they do, they just cp /usr/bin/limits > to /bin, and do not submit a bug report or send an email. > That saddens me. =/ From owner-svn-src-stable@freebsd.org Mon Apr 9 15:19:16 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C51DF8827E; Mon, 9 Apr 2018 15:19:16 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EE1897953B; Mon, 9 Apr 2018 15:19:14 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 9F2005416; Mon, 9 Apr 2018 15:19:11 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Mon, 9 Apr 2018 15:19:09 +0000 From: Glen Barber To: Warner Losh Cc: Brooks Davis , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r332288 - in stable/11/sys: dev/an dev/ath dev/cxgbe dev/de dev/en dev/fatm dev/hatm dev/if_ndis dev/iwi dev/ixgbe dev/ixl dev/mlx4/mlx4_en dev/mlx5/mlx5_en dev/mwl dev/nxge dev/oce dev... Message-ID: <20180409151909.GA86045@FreeBSD.org> References: <201804081654.w38Gs7JY007779@repo.freebsd.org> <20180409135849.GA84067@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="C7zPtVaVf+AK4Oqc" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 15:19:16 -0000 --C7zPtVaVf+AK4Oqc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 09, 2018 at 09:11:44AM -0600, Warner Losh wrote: > On Mon, Apr 9, 2018 at 7:58 AM, Glen Barber wrote: >=20 > > On Sun, Apr 08, 2018 at 04:54:07PM +0000, Brooks Davis wrote: > > > Author: brooks > > > Date: Sun Apr 8 16:54:07 2018 > > > New Revision: 332288 > > > URL: https://svnweb.freebsd.org/changeset/base/332288 > > > > > > Log: > > > MFC r331797: > > > > > > Use an accessor function to access ifr_data. > > > > > > This fixes 32-bit compat (no ioctl command defintions are required > > > as struct ifreq is the same size). > > > > > > Reviewed by: kib > > > Obtained from: CheriBSD > > > Sponsored by: DARPA, AFRL > > > Differential Revision: https://reviews.freebsd.org/D14900 > > > > > > Modified: > > [...] > > > stable/11/sys/dev/wl/if_wl.c > > > > > Directory Properties: > > > stable/11/ (props changed) > > > > > [...] > > > Modified: stable/11/sys/dev/wl/if_wl.c > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > --- stable/11/sys/dev/wl/if_wl.c Sun Apr 8 16:46:24 2018 > > (r332287) > > > +++ stable/11/sys/dev/wl/if_wl.c Sun Apr 8 16:54:07 2018 > > (r332288) > > > @@ -1313,7 +1313,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t > > data) > > > } > > > WL_UNLOCK(sc); > > > > > > - error =3D copyout(psa_buf, ifr->ifr_data, sizeof(psa_buf)); > > > + error =3D copyout(psa_buf, ifr_data_get_ptr(ifr), sizeof(psa_bu= f)); > > > break; > > > > > > > > > @@ -1323,7 +1323,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t > > data) > > > if ((error =3D priv_check(td, PRIV_DRIVER))) > > > break; > > > > > > - error =3D copyin(ifr->ifr_data, psa_buf, sizeof(psa_buf)); > > > + error =3D copyin(ifr_data_get_ptr(ifr), psa_buf, sizeof(psa_buf= )); > > > if (error) > > > break; > > > > > > @@ -1357,7 +1357,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t > > data) > > > /* get the current NWID out of the sc since we stored it there = */ > > > case SIOCGWLCNWID: > > > WL_LOCK(sc); > > > - ifr->ifr_data =3D (caddr_t) (sc->nwid[0] << 8 | sc->nwid[1]); > > > + ifr_data_get_ptr(ifr) =3D (caddr_t) (sc->nwid[0] << 8 | sc->nwi= d[1]); > > > WL_UNLOCK(sc); > > > break; > > > > > > > This part of the change appears to have broken i386 with the following: > > > > /usr/src/sys/modules/wl/../../dev/wl/if_wl.c:1360:24: error: expression > > is not assignable > > ifr_data_get_ptr(ifr) =3D (caddr_t) (sc->nwid[0] << 8 | > > sc->nwid[1]); > > ~~~~~~~~~~~~~~~~~~~~~ ^ > > 1 error generated. > > --- if_wl.o --- > > *** [if_wl.o] Error code 1 > > > > make[4]: stopped in /usr/src/sys/modules/wl > > 1 error > > >=20 > wl has been removed in -current. It's pre-802.11 ISA card with thin mark= et > penetration. I would be shocked if anybody has run this on a FreeBSD syst= em > > 4.x. >=20 This commit is to stable/11. Glen --C7zPtVaVf+AK4Oqc Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEjRJAPC5sqwhs9k2jAxRYpUeP4pMFAlrLhGkACgkQAxRYpUeP 4pMzKg/+IF5RcZA2549N9JKhbGbIMtbGvqJv8YYvRI8arP77ABLzUQIb7VietEv9 Ddvtg64dRuEWQiHGpkZZbey5qN2uw8A2hVXqqNA1YKXoZUEsVw8PD6ww8dVy9N7n T+iPE/7oRMlby97fH/p2SshZiQ0rlghkNvidkEwjjj1cdGhwQLMGOATN8TR7zs0t 6dJnuJxcUgwOdC84U9q10J17x0Kx+vmz0szikCR0AF5wURkheYwTZUKsYgZ4Bjlu hskgFyd+S6emqpIjZ61RMJ1dT0IjcyoxMhYLmghQjcF3t2Okg+CWdAAtEv196S8x /+08kMYfKWu8anxqFbLf4TRcBL5rMxp9unXY/9Fq2wn0Xipz6AtGuPjarBNxMOJq 744FZU9rQTm7N6oU5cN7YrUDI7uododbFC5Ir3ZgzP8IegaxMOmFgo+CK/bOL/88 X5ddvQXeKmw9eV6ko7iV/ULS4KVj5Ze/LT6Gp0HSd5pXbBLEezlSTR4kgxzkBS8s 1b3ViZ98XteVHgP52Hp6hyJisdM8pVEsJVppfDcCU6rfgGJVu+56BAYQcrWwBQrC d/Ub9kEMjzh81HOfwRwJ5Vqk4rpWL0DmAaW8wD9yKUeSfda8tDkxrdEeismHmWX8 3bf5fyfVHKKQQ3YVEjEG94L3gcTo39uq5/nZGKhjoWUIPq/sGtc= =dxuA -----END PGP SIGNATURE----- --C7zPtVaVf+AK4Oqc-- From owner-svn-src-stable@freebsd.org Mon Apr 9 15:20:02 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4A4BF8836D; Mon, 9 Apr 2018 15:20:01 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63FD179CCF; Mon, 9 Apr 2018 15:20:01 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w39FJxM6019162; Mon, 9 Apr 2018 08:19:59 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w39FJx7f019161; Mon, 9 Apr 2018 08:19:59 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804091519.w39FJx7f019161@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r332288 - in stable/11/sys: dev/an dev/ath dev/cxgbe dev/de dev/en dev/fatm dev/hatm dev/if_ndis dev/iwi dev/ixgbe dev/ixl dev/mlx4/mlx4_en dev/mlx5/mlx5_en dev/mwl dev/nxge dev/oce dev... In-Reply-To: To: Warner Losh Date: Mon, 9 Apr 2018 08:19:59 -0700 (PDT) CC: Glen Barber , Brooks Davis , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 15:20:02 -0000 > On Mon, Apr 9, 2018 at 7:58 AM, Glen Barber wrote: > > > On Sun, Apr 08, 2018 at 04:54:07PM +0000, Brooks Davis wrote: > > > Author: brooks > > > Date: Sun Apr 8 16:54:07 2018 > > > New Revision: 332288 > > > URL: https://svnweb.freebsd.org/changeset/base/332288 > > > > > > Log: > > > MFC r331797: > > > > > > Use an accessor function to access ifr_data. > > > > > > This fixes 32-bit compat (no ioctl command defintions are required > > > as struct ifreq is the same size). > > > > > > Reviewed by: kib > > > Obtained from: CheriBSD > > > Sponsored by: DARPA, AFRL > > > Differential Revision: https://reviews.freebsd.org/D14900 > > > > > > Modified: > > [...] > > > stable/11/sys/dev/wl/if_wl.c > > > > > Directory Properties: > > > stable/11/ (props changed) > > > > > [...] > > > Modified: stable/11/sys/dev/wl/if_wl.c > > > ============================================================ > > ================== > > > --- stable/11/sys/dev/wl/if_wl.c Sun Apr 8 16:46:24 2018 > > (r332287) > > > +++ stable/11/sys/dev/wl/if_wl.c Sun Apr 8 16:54:07 2018 > > (r332288) > > > @@ -1313,7 +1313,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t > > data) > > > } > > > WL_UNLOCK(sc); > > > > > > - error = copyout(psa_buf, ifr->ifr_data, sizeof(psa_buf)); > > > + error = copyout(psa_buf, ifr_data_get_ptr(ifr), sizeof(psa_buf)); > > > break; > > > > > > > > > @@ -1323,7 +1323,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t > > data) > > > if ((error = priv_check(td, PRIV_DRIVER))) > > > break; > > > > > > - error = copyin(ifr->ifr_data, psa_buf, sizeof(psa_buf)); > > > + error = copyin(ifr_data_get_ptr(ifr), psa_buf, sizeof(psa_buf)); > > > if (error) > > > break; > > > > > > @@ -1357,7 +1357,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t > > data) > > > /* get the current NWID out of the sc since we stored it there */ > > > case SIOCGWLCNWID: > > > WL_LOCK(sc); > > > - ifr->ifr_data = (caddr_t) (sc->nwid[0] << 8 | sc->nwid[1]); > > > + ifr_data_get_ptr(ifr) = (caddr_t) (sc->nwid[0] << 8 | sc->nwid[1]); > > > WL_UNLOCK(sc); > > > break; > > > > > > > This part of the change appears to have broken i386 with the following: > > > > /usr/src/sys/modules/wl/../../dev/wl/if_wl.c:1360:24: error: expression > > is not assignable > > ifr_data_get_ptr(ifr) = (caddr_t) (sc->nwid[0] << 8 | > > sc->nwid[1]); > > ~~~~~~~~~~~~~~~~~~~~~ ^ > > 1 error generated. > > --- if_wl.o --- > > *** [if_wl.o] Error code 1 > > > > make[4]: stopped in /usr/src/sys/modules/wl > > 1 error > > > > wl has been removed in -current. It's pre-802.11 ISA card with thin market > penetration. I would be shocked if anybody has run this on a FreeBSD system > > 4.x. The last version of our Wireless WAN using these cards was at 5.4, the wl cards have been decomissioned and replaced with newer hardware, either way, we need stable/11 i386 to build please :-) -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-stable@freebsd.org Mon Apr 9 15:21:41 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E173DF886FD; Mon, 9 Apr 2018 15:21:40 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A47B7ACD6; Mon, 9 Apr 2018 15:21:40 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 82CE520776; Mon, 9 Apr 2018 15:21:40 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w39FLeVN087771; Mon, 9 Apr 2018 15:21:40 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39FLeED087770; Mon, 9 Apr 2018 15:21:40 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804091521.w39FLeED087770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 9 Apr 2018 15:21:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332329 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 332329 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 15:21:41 -0000 Author: brooks Date: Mon Apr 9 15:21:40 2018 New Revision: 332329 URL: https://svnweb.freebsd.org/changeset/base/332329 Log: MFC r332151: ifconf(): correct handling of sockaddrs smaller than struct sockaddr. Portable programs that use SIOCGIFCONF (e.g. traceroute) assume that each pseudo ifreq is of length MAX(sizeof(struct ifreq), sizeof(ifr_name) + ifr_addr.sa_len). For short sockaddrs we copied too much from the source sockaddr resulting in a heap leak. I believe only one such sockaddr exists (struct sockaddr_sco which is 8 bytes) and it is unclear if such sockaddrs end up on interfaces in practice. If it did, the result would be an 8 byte heap leak on current architectures. admbugs: 869 Reviewed by: kib Obtained from: CheriBSD Security: kernel heap leak Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14981 Modified: stable/11/sys/net/if.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/if.c ============================================================================== --- stable/11/sys/net/if.c Mon Apr 9 15:11:17 2018 (r332328) +++ stable/11/sys/net/if.c Mon Apr 9 15:21:40 2018 (r332329) @@ -3153,7 +3153,13 @@ again: max_len += sizeof(ifr); } else if (sa->sa_len <= sizeof(*sa)) { - ifr.ifr_addr = *sa; + if (sa->sa_len < sizeof(*sa)) { + memset(&ifr.ifr_ifru.ifru_addr, 0, + sizeof(ifr.ifr_ifru.ifru_addr)); + memcpy(&ifr.ifr_ifru.ifru_addr, sa, + sa->sa_len); + } else + ifr.ifr_ifru.ifru_addr = *sa; sbuf_bcat(sb, &ifr, sizeof(ifr)); max_len += sizeof(ifr); } else { From owner-svn-src-stable@freebsd.org Mon Apr 9 15:29:15 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB8EFF88EDF; Mon, 9 Apr 2018 15:29:15 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5973A7F105; Mon, 9 Apr 2018 15:29:15 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 50DF5207B2; Mon, 9 Apr 2018 15:29:15 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w39FTFk9089687; Mon, 9 Apr 2018 15:29:15 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39FTFdH089686; Mon, 9 Apr 2018 15:29:15 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201804091529.w39FTFdH089686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Mon, 9 Apr 2018 15:29:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332330 - stable/10/sys/netpfil/pf X-SVN-Group: stable-10 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/10/sys/netpfil/pf X-SVN-Commit-Revision: 332330 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 15:29:15 -0000 Author: kp Date: Mon Apr 9 15:29:14 2018 New Revision: 332330 URL: https://svnweb.freebsd.org/changeset/base/332330 Log: MFC r331225: pf: Fix memory leak in DIOCRADDTABLES If a user attempts to add two tables with the same name the duplicate table will not be added, but we forgot to free the duplicate table, leaking memory. Ensure we free the duplicate table in the error path. Reported by: Coverity CID: 1382111 Modified: stable/10/sys/netpfil/pf/pf_table.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netpfil/pf/pf_table.c ============================================================================== --- stable/10/sys/netpfil/pf/pf_table.c Mon Apr 9 15:21:40 2018 (r332329) +++ stable/10/sys/netpfil/pf/pf_table.c Mon Apr 9 15:29:14 2018 (r332330) @@ -1123,8 +1123,10 @@ pfr_add_tables(struct pfr_table *tbl, int size, int *n if (p == NULL) senderr(ENOMEM); SLIST_FOREACH(q, &addq, pfrkt_workq) { - if (!pfr_ktable_compare(p, q)) + if (!pfr_ktable_compare(p, q)) { + pfr_destroy_ktable(p, 0); goto _skip; + } } SLIST_INSERT_HEAD(&addq, p, pfrkt_workq); xadd++; From owner-svn-src-stable@freebsd.org Mon Apr 9 15:30:12 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7F10F89075 for ; Mon, 9 Apr 2018 15:30:11 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 245917FA1A; Mon, 9 Apr 2018 15:30:09 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w39FU3Q6019212; Mon, 9 Apr 2018 08:30:03 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w39FU3vU019211; Mon, 9 Apr 2018 08:30:03 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804091530.w39FU3vU019211@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r331880 - stable/11/etc In-Reply-To: To: Kyle Evans Date: Mon, 9 Apr 2018 08:30:03 -0700 (PDT) CC: "Rodney W. Grimes" , Niclas Zeising , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , svn-src-stable-11@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 15:30:12 -0000 > On Mon, Apr 9, 2018 at 10:14 AM, Rodney W. Grimes > wrote: > >> On Mon, Apr 9, 2018 at 9:46 AM, Rodney W. Grimes > >> wrote: > >> >> On 04/02/18 17:39, Rodney W. Grimes wrote: > >> >> >> Author: kevans > >> >> >> Date: Mon Apr 2 15:28:48 2018 > >> >> >> New Revision: 331880 > >> >> >> URL: https://svnweb.freebsd.org/changeset/base/331880 > >> >> >> > >> >> >> Log: > >> >> >> MFC r328331: Support configuring arbitrary limits(1) for any rc.conf daemon > >> >> >> > >> >> >> Usage is ${name}_limits, and the argument is any flags accepted by > >> >> >> limits(1), such as `-n 100' (e.g. only allow 100 open files). > >> >> >> > >> >> >> Modified: > >> >> >> stable/11/etc/rc.subr > >> >> >> Directory Properties: > >> >> >> stable/11/ (props changed) > >> >> >> > >> >> >> Modified: stable/11/etc/rc.subr > >> >> >> ============================================================================== > >> >> >> --- stable/11/etc/rc.subr Mon Apr 2 15:07:41 2018 (r331879) > >> >> >> +++ stable/11/etc/rc.subr Mon Apr 2 15:28:48 2018 (r331880) > >> >> >> @@ -773,6 +773,8 @@ check_startmsgs() > >> >> >> # > >> >> >> # ${name}_login_class n Login class to use, else "daemon". > >> >> >> # > >> >> >> +# ${name}_limits n limits(1) to apply to ${command}. > >> >> >> +# > >> >> > > >> >> > Caution, limits(1) is in /usr/bin, this code can fail if used before > >> >> > /usr is mounted. (Ie, our rc.initdiskless) is probably broken by > >> >> > this change if a call is made to limits. > >> >> > > >> >> > > >> >> > >> >> Sorry for jumping on this so late. This is also an issue in CURRENT, > >> >> and has been since at least 2016. > >> > > >> > I was aware that it was an issue and why I made a comment about it > >> > being MFC'ed. Though I had forgot a bug report existed. > >> > >> I'm kind of surprised we haven't had more complaints about this- the > >> original commit for this stuff landed before stable/11 was even > >> branched, so it's been broken for all of 11.x's lifetime. > > > > History has taught me it takes a long time for this type of > > breakage to usually surface in a noticable way. Also I think > > until you merged this last ${name}_limits thing it actually > > didn't cause an issue, except for the few like me running > > diskless systems and or seperate /usr. > > I don't see how this merge could possibly have been the cause of any > claimed issues- like I said before, it didn't add any limits > invocations, it added an arg to the limits invocation that already > existed. You can see this pretty clearly from the diff, we didn't even > change any conditions for limits to be invoked. limits_mysql="NO" is defined by the startup script for mysql, that now causes /etc/rc to try and use that variable in a different way. You added a variable, one that was already in use by some other /etc/rc* related component. Collision of differening uses is causing errors. > > This latest issue is a name space collision between base and ports. > > > > People who see limits issues due to missing /usr files usually > > know how to work around it, and they do, they just cp /usr/bin/limits > > to /bin, and do not submit a bug report or send an email. > > > > That saddens me. =/ Sorry for the reality check. Breakage can often take years before someone notices some side effect that was never for seen. Its just the nature of the beast. I am *still* dealing with the fall out that was the FreeBSD 6.0 conversion from standalone ata code to ata over cam. Our error reporting and handling is still not as robust as that which I have in my 5.4p8 based systems. I think it was near 2 years before someone noticed that a change to telldir() caused Samba performance to go in the tank. And iirc that change was done to make it Posix compliant! I try to keep in mind that every bug being fixed often has an unknown new bug being introduced, and some times 2. If you do not believe this, go look at the coverty graphs, despite the fact that many coverty errors have been fixed, we are actually increasing the number of issues over the long term. In the statistic process model of manufacturing when you see this the first thing that comes to mind is "we have an open loop and out of control manufacturing system". Now that saddens me. =/ -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-stable@freebsd.org Mon Apr 9 15:32:52 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AED5F8956D; Mon, 9 Apr 2018 15:32:52 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B10DC8141F; Mon, 9 Apr 2018 15:32:51 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 7E3D25A9F13; Mon, 9 Apr 2018 15:32:50 +0000 (UTC) Date: Mon, 9 Apr 2018 15:32:50 +0000 From: Brooks Davis To: Glen Barber Cc: Brooks Davis , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r332288 - in stable/11/sys: dev/an dev/ath dev/cxgbe dev/de dev/en dev/fatm dev/hatm dev/if_ndis dev/iwi dev/ixgbe dev/ixl dev/mlx4/mlx4_en dev/mlx5/mlx5_en dev/mwl dev/nxge dev/oce dev... Message-ID: <20180409153250.GB3560@spindle.one-eyed-alien.net> References: <201804081654.w38Gs7JY007779@repo.freebsd.org> <20180409135849.GA84067@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gKMricLos+KVdGMg" Content-Disposition: inline In-Reply-To: <20180409135849.GA84067@FreeBSD.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 15:32:52 -0000 --gKMricLos+KVdGMg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 09, 2018 at 01:58:49PM +0000, Glen Barber wrote: > On Sun, Apr 08, 2018 at 04:54:07PM +0000, Brooks Davis wrote: > > Author: brooks > > Date: Sun Apr 8 16:54:07 2018 > > New Revision: 332288 > > URL: https://svnweb.freebsd.org/changeset/base/332288 > >=20 > > Log: > > MFC r331797: > > =20 > > Use an accessor function to access ifr_data. > > =20 > > This fixes 32-bit compat (no ioctl command defintions are required > > as struct ifreq is the same size). > > =20 > > Reviewed by: kib > > Obtained from: CheriBSD > > Sponsored by: DARPA, AFRL > > Differential Revision: https://reviews.freebsd.org/D14900 > >=20 > > Modified: > [...] > > stable/11/sys/dev/wl/if_wl.c >=20 > > Directory Properties: > > stable/11/ (props changed) > >=20 > [...] > > Modified: stable/11/sys/dev/wl/if_wl.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- stable/11/sys/dev/wl/if_wl.c Sun Apr 8 16:46:24 2018 (r332287) > > +++ stable/11/sys/dev/wl/if_wl.c Sun Apr 8 16:54:07 2018 (r332288) > > @@ -1313,7 +1313,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t da= ta) > > } > > WL_UNLOCK(sc); > > =20 > > - error =3D copyout(psa_buf, ifr->ifr_data, sizeof(psa_buf)); > > + error =3D copyout(psa_buf, ifr_data_get_ptr(ifr), sizeof(psa_buf)); > > break; > > =20 > > =20 > > @@ -1323,7 +1323,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t da= ta) > > if ((error =3D priv_check(td, PRIV_DRIVER))) > > break; > > =20 > > - error =3D copyin(ifr->ifr_data, psa_buf, sizeof(psa_buf)); > > + error =3D copyin(ifr_data_get_ptr(ifr), psa_buf, sizeof(psa_buf)); > > if (error) > > break; > > =09 > > @@ -1357,7 +1357,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t da= ta) > > /* get the current NWID out of the sc since we stored it there */ > > case SIOCGWLCNWID: > > WL_LOCK(sc); > > - ifr->ifr_data =3D (caddr_t) (sc->nwid[0] << 8 | sc->nwid[1]); > > + ifr_data_get_ptr(ifr) =3D (caddr_t) (sc->nwid[0] << 8 | sc->nwid[1]); > > WL_UNLOCK(sc); > > break; > > =20 >=20 > This part of the change appears to have broken i386 with the following: Sorry about this, will fix shortly. -- Brooks --gKMricLos+KVdGMg Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJay4ehAAoJEKzQXbSebgfAErIH/3SD+9q+NLglY1UYdmltmGHE m/ExxRsFPAD46U1GTqWvqoDXLwWTjMf7smOO6ZRbTdio2LDL8GidwrkcYxaMnNJI wTx5NeXBmEWuthpsBvkwCRSGSJNNfPpBZPZh8FoZAyuTVW0iTMzKlxzPlYEWVIX2 b3RTzTuGz6TUhY1DeX5kMAnhGjjU+lhCpM0dqSzJo6kMjqnBDsyVhijT05dhMu6x Fgb2WUto1mAZe7gteXms094Ew0lV/XPeUlySwWVF8kSENk1DtGcFKSZynsHnj7uT AviVYckVnjsWt2FqxWWpbza9Msm2TmuKMqytRCMPBvJHjOs2wNQ2bFb6CkHUHo8= =X/6a -----END PGP SIGNATURE----- --gKMricLos+KVdGMg-- From owner-svn-src-stable@freebsd.org Mon Apr 9 15:36:50 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA792F89B3D; Mon, 9 Apr 2018 15:36:49 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com [209.85.215.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C6CD83709; Mon, 9 Apr 2018 15:36:49 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-lf0-f48.google.com with SMTP id j20-v6so7224369lfk.2; Mon, 09 Apr 2018 08:36:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=C7LezMUtjWuvFLw5pdRHZ37U6/aXh9f+gHl6wQnjOTg=; b=Jy2zoCROJQuEOfVgBCdQHsOCyxwx2If5xfYHXVss/yy0iiuLZ2ldReEAdLRMoDqKld C8/TqX6zjSZUN/u01WwrMXVo6Q9cn4ncCwfOTNLp36zy53oFlZ376i7LZi4gnLoN6/qe pmqYy/pY1NbmxkMHI8IteYZSKX8jpXS1YgcB4it7XlwjgjysYV7Lhl9nbAZx52Ftux/r xDVGaxRPFBtbxrMuBdLQGOeBxuPX033kT9pdQr1bZrK9sDVJ4jnigt7ABcGKuGn7Rzsg vGZ2aQs2EXO/iA6v/y7566cVr6NR296WHbUqede9DHbiFQZR9zYgtmXmYkdTz6yzRXrQ h9Sw== X-Gm-Message-State: ALQs6tBhgg2hrdK1f7iaNS/K+nf56mDgedBVh7PL6x4Ig02P2lJ7OPrw 7I1rNw6VG6hCOKBvwv6PXl9bo9cN X-Google-Smtp-Source: AIpwx4/fhLEZBuoPG1+irzjWXzjNiQ74rG0mYhDeA079IdNPwy3CAPmXn3O91tBxzaxtLqGOwgY56g== X-Received: by 2002:a19:b516:: with SMTP id e22-v6mr22990297lff.47.1523288207100; Mon, 09 Apr 2018 08:36:47 -0700 (PDT) Received: from mail-lf0-f46.google.com (mail-lf0-f46.google.com. [209.85.215.46]) by smtp.gmail.com with ESMTPSA id z19sm117823ljz.1.2018.04.09.08.36.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Apr 2018 08:36:46 -0700 (PDT) Received: by mail-lf0-f46.google.com with SMTP id x70-v6so7208789lfa.0; Mon, 09 Apr 2018 08:36:46 -0700 (PDT) X-Received: by 2002:a19:c4c8:: with SMTP id u191-v6mr23141263lff.109.1523288206725; Mon, 09 Apr 2018 08:36:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.129.90 with HTTP; Mon, 9 Apr 2018 08:36:26 -0700 (PDT) In-Reply-To: <201804091530.w39FU3vU019211@pdx.rh.CN85.dnsmgr.net> References: <201804091530.w39FU3vU019211@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Mon, 9 Apr 2018 10:36:26 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r331880 - stable/11/etc To: "Rodney W. Grimes" Cc: Niclas Zeising , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 15:36:50 -0000 On Mon, Apr 9, 2018 at 10:30 AM, Rodney W. Grimes wrote: >> On Mon, Apr 9, 2018 at 10:14 AM, Rodney W. Grimes >> wrote: >> >> On Mon, Apr 9, 2018 at 9:46 AM, Rodney W. Grimes >> >> wrote: >> >> >> On 04/02/18 17:39, Rodney W. Grimes wrote: >> >> >> >> Author: kevans >> >> >> >> Date: Mon Apr 2 15:28:48 2018 >> >> >> >> New Revision: 331880 >> >> >> >> URL: https://svnweb.freebsd.org/changeset/base/331880 >> >> >> >> >> >> >> >> Log: >> >> >> >> MFC r328331: Support configuring arbitrary limits(1) for any rc.conf daemon >> >> >> >> >> >> >> >> Usage is ${name}_limits, and the argument is any flags accepted by >> >> >> >> limits(1), such as `-n 100' (e.g. only allow 100 open files). >> >> >> >> >> >> >> >> Modified: >> >> >> >> stable/11/etc/rc.subr >> >> >> >> Directory Properties: >> >> >> >> stable/11/ (props changed) >> >> >> >> >> >> >> >> Modified: stable/11/etc/rc.subr >> >> >> >> ============================================================================== >> >> >> >> --- stable/11/etc/rc.subr Mon Apr 2 15:07:41 2018 (r331879) >> >> >> >> +++ stable/11/etc/rc.subr Mon Apr 2 15:28:48 2018 (r331880) >> >> >> >> @@ -773,6 +773,8 @@ check_startmsgs() >> >> >> >> # >> >> >> >> # ${name}_login_class n Login class to use, else "daemon". >> >> >> >> # >> >> >> >> +# ${name}_limits n limits(1) to apply to ${command}. >> >> >> >> +# >> >> >> > >> >> >> > Caution, limits(1) is in /usr/bin, this code can fail if used before >> >> >> > /usr is mounted. (Ie, our rc.initdiskless) is probably broken by >> >> >> > this change if a call is made to limits. >> >> >> > >> >> >> > >> >> >> >> >> >> Sorry for jumping on this so late. This is also an issue in CURRENT, >> >> >> and has been since at least 2016. >> >> > >> >> > I was aware that it was an issue and why I made a comment about it >> >> > being MFC'ed. Though I had forgot a bug report existed. >> >> >> >> I'm kind of surprised we haven't had more complaints about this- the >> >> original commit for this stuff landed before stable/11 was even >> >> branched, so it's been broken for all of 11.x's lifetime. >> > >> > History has taught me it takes a long time for this type of >> > breakage to usually surface in a noticable way. Also I think >> > until you merged this last ${name}_limits thing it actually >> > didn't cause an issue, except for the few like me running >> > diskless systems and or seperate /usr. >> >> I don't see how this merge could possibly have been the cause of any >> claimed issues- like I said before, it didn't add any limits >> invocations, it added an arg to the limits invocation that already >> existed. You can see this pretty clearly from the diff, we didn't even >> change any conditions for limits to be invoked. > > limits_mysql="NO" is defined by the startup script for mysql, > that now causes /etc/rc to try and use that variable in a > different way. > > You added a variable, one that was already in use by some other > /etc/rc* related component. Collision of differening uses is > causing errors. > Ah, apologies, I misread your previous e-mail and had interpreted it as you claiming again that this broke things for those of you "running diskless systems and or seperate /usr." -- this other breakage, these are things we can fix and aren't really large hurdles to climb over. We just need people like 0mp that are actually inclined to address it in ports, and we need to actually communicate changes like this with ports people and assess what's going to break and make a plan to get it fixed. IMO this in particular wasn't a major change, and it shouldn't have been too big of a deal (unlike the commit that it built upon). I don't think it should've been broken in head for two months in the various ports that 0mp has identified- even if people don't run these databases on head, we should've assessed the fallout and fixed it somewhere in the two month's time. We're not talking half the ports tree, we're talking < 30 ports. =( From owner-svn-src-stable@freebsd.org Mon Apr 9 15:53:06 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E00CDF8AD93 for ; Mon, 9 Apr 2018 15:53:05 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 567E36C8E9; Mon, 9 Apr 2018 15:53:03 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w39Fqvqf019417; Mon, 9 Apr 2018 08:52:57 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w39Fqv2S019416; Mon, 9 Apr 2018 08:52:57 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804091552.w39Fqv2S019416@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r331880 - stable/11/etc In-Reply-To: To: Kyle Evans Date: Mon, 9 Apr 2018 08:52:56 -0700 (PDT) CC: "Rodney W. Grimes" , Niclas Zeising , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , svn-src-stable-11@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 15:53:06 -0000 > On Mon, Apr 9, 2018 at 10:30 AM, Rodney W. Grimes > wrote: > >> On Mon, Apr 9, 2018 at 10:14 AM, Rodney W. Grimes > >> wrote: > >> >> On Mon, Apr 9, 2018 at 9:46 AM, Rodney W. Grimes > >> >> wrote: > >> >> >> On 04/02/18 17:39, Rodney W. Grimes wrote: > >> >> >> >> Author: kevans > >> >> >> >> Date: Mon Apr 2 15:28:48 2018 > >> >> >> >> New Revision: 331880 > >> >> >> >> URL: https://svnweb.freebsd.org/changeset/base/331880 > >> >> >> >> > >> >> >> >> Log: > >> >> >> >> MFC r328331: Support configuring arbitrary limits(1) for any rc.conf daemon > >> >> >> >> > >> >> >> >> Usage is ${name}_limits, and the argument is any flags accepted by > >> >> >> >> limits(1), such as `-n 100' (e.g. only allow 100 open files). > >> >> >> >> > >> >> >> >> Modified: > >> >> >> >> stable/11/etc/rc.subr > >> >> >> >> Directory Properties: > >> >> >> >> stable/11/ (props changed) > >> >> >> >> > >> >> >> >> Modified: stable/11/etc/rc.subr > >> >> >> >> ============================================================================== > >> >> >> >> --- stable/11/etc/rc.subr Mon Apr 2 15:07:41 2018 (r331879) > >> >> >> >> +++ stable/11/etc/rc.subr Mon Apr 2 15:28:48 2018 (r331880) > >> >> >> >> @@ -773,6 +773,8 @@ check_startmsgs() > >> >> >> >> # > >> >> >> >> # ${name}_login_class n Login class to use, else "daemon". > >> >> >> >> # > >> >> >> >> +# ${name}_limits n limits(1) to apply to ${command}. > >> >> >> >> +# > >> >> >> > > >> >> >> > Caution, limits(1) is in /usr/bin, this code can fail if used before > >> >> >> > /usr is mounted. (Ie, our rc.initdiskless) is probably broken by > >> >> >> > this change if a call is made to limits. > >> >> >> > > >> >> >> > > >> >> >> > >> >> >> Sorry for jumping on this so late. This is also an issue in CURRENT, > >> >> >> and has been since at least 2016. > >> >> > > >> >> > I was aware that it was an issue and why I made a comment about it > >> >> > being MFC'ed. Though I had forgot a bug report existed. > >> >> > >> >> I'm kind of surprised we haven't had more complaints about this- the > >> >> original commit for this stuff landed before stable/11 was even > >> >> branched, so it's been broken for all of 11.x's lifetime. > >> > > >> > History has taught me it takes a long time for this type of > >> > breakage to usually surface in a noticable way. Also I think > >> > until you merged this last ${name}_limits thing it actually > >> > didn't cause an issue, except for the few like me running > >> > diskless systems and or seperate /usr. > >> > >> I don't see how this merge could possibly have been the cause of any > >> claimed issues- like I said before, it didn't add any limits > >> invocations, it added an arg to the limits invocation that already > >> existed. You can see this pretty clearly from the diff, we didn't even > >> change any conditions for limits to be invoked. > > > > limits_mysql="NO" is defined by the startup script for mysql, > > that now causes /etc/rc to try and use that variable in a > > different way. > > > > You added a variable, one that was already in use by some other > > /etc/rc* related component. Collision of differening uses is > > causing errors. > > > > Ah, apologies, I misread your previous e-mail and had interpreted it > as you claiming again that this broke things for those of you "running > diskless systems and or seperate /usr." -- this other breakage, these > are things we can fix and aren't really large hurdles to climb over. Mostly true, other than the hurdle of that 0mp mentions in his https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227205 We need to remember that we cannot simply switch to the new mechanism as it is only available in 12-CURRENT and soon in 11-STABLE (and 11.2). I am not sure how to handle that with the users, it is a operational interface change in how limits are done for these ports and probably is going to break a lot of peoples systems if they try to update from 11.1 to 11.2 because there /etc/rc.conf file is full of old stuff that this new stuff is incompatible with. IMHO, it would be best to post pone this change to 12, as people are more willing to suffer painful upgrades when going between major versions. > > We just need people like 0mp that are actually inclined to address it > in ports, and we need to actually communicate changes like this with > ports people and assess what's going to break and make a plan to get > it fixed. Problem was/is no one had the foresight to see the ports breakage coming and avoid it in some way. That happens, its engineering, lets find a fix and move on. > IMO this in particular wasn't a major change, and it shouldn't have > been too big of a deal (unlike the commit that it built upon). I don't > think it should've been broken in head for two months in the various > ports that 0mp has identified- even if people don't run these > databases on head, we should've assessed the fallout and fixed it > somewhere in the two month's time. We're not talking half the ports > tree, we're talking < 30 ports. =( Its usually the tiny, minor, itty bit little nit change that bites the hardest :-) -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-stable@freebsd.org Mon Apr 9 16:07:26 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F8C4F8BAEB; Mon, 9 Apr 2018 16:07:26 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-lf0-f50.google.com (mail-lf0-f50.google.com [209.85.215.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A24E1747E7; Mon, 9 Apr 2018 16:07:25 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-lf0-f50.google.com with SMTP id d20-v6so1513506lfe.3; Mon, 09 Apr 2018 09:07:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=0Blp8pOn788k9UegBzOysyf31Xj/C6SNpy4aXkUesI0=; b=kF2ln9a2bzTg6jwyY16/Cx2RuyReUUw13kFA8D9N64gdmn7i9mFaTE0IOEGMmXmUy+ Hgqv/mioRTh275N345q5+9n1EjJCZVCJx7MibMBREwwe2I+4GQj47HWBOyu1GX33a8ko eEqiJUqvILNFZqdqQNnRIggF/JQtbJqJIv1XqplPdToyM++UHBhzrFYthUxa5mFW97Kp eg5uqojPFJIXYBIoQyWFBwzvCcO1OkMMui5lqpH2UAisCt3Ss0b/vvQph4wCXn2ElDgP jzb6zx5laGF7MlF3zKfBIFNH9Cdm5Hy7V+2Nn5GOXCLgDjQv1zVD3K7/y9SRhEmT2IC7 /D6A== X-Gm-Message-State: AElRT7HMcuEQ5KRv0u/w013VvoV4qFz1noubVA8DM6PsuayCH3Yo7Iqa FdcrTGg+h7TVGxZ5wkJ/nveobsH3 X-Google-Smtp-Source: AIpwx49oS/3UrZfFOvfuuB++MiihjCIoReAAmxJwjHa8fZsGcJvXDtRk9zZ06wdAE2fuRXqHGL71XQ== X-Received: by 10.46.23.202 with SMTP id 71mr22704818ljx.49.1523284439376; Mon, 09 Apr 2018 07:33:59 -0700 (PDT) Received: from mail-lf0-f54.google.com (mail-lf0-f54.google.com. [209.85.215.54]) by smtp.gmail.com with ESMTPSA id u19sm92263lje.29.2018.04.09.07.33.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Apr 2018 07:33:59 -0700 (PDT) Received: by mail-lf0-f54.google.com with SMTP id c78-v6so6896240lfh.1; Mon, 09 Apr 2018 07:33:59 -0700 (PDT) X-Received: by 10.46.29.1 with SMTP id d1mr22723804ljd.22.1523284439092; Mon, 09 Apr 2018 07:33:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.129.90 with HTTP; Mon, 9 Apr 2018 07:33:38 -0700 (PDT) In-Reply-To: <20180409142906.74ohdz4eynugkqw5@mutt-hbsd> References: <201804021528.w32FSmd7023856@repo.freebsd.org> <20180409142906.74ohdz4eynugkqw5@mutt-hbsd> From: Kyle Evans Date: Mon, 9 Apr 2018 09:33:38 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r331880 - stable/11/etc To: Shawn Webb Cc: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 16:07:26 -0000 On Mon, Apr 9, 2018 at 9:29 AM, Shawn Webb wrote: > On Mon, Apr 02, 2018 at 03:28:48PM +0000, Kyle Evans wrote: >> Author: kevans >> Date: Mon Apr 2 15:28:48 2018 >> New Revision: 331880 >> URL: https://svnweb.freebsd.org/changeset/base/331880 >> >> Log: >> MFC r328331: Support configuring arbitrary limits(1) for any rc.conf daemon >> >> Usage is ${name}_limits, and the argument is any flags accepted by >> limits(1), such as `-n 100' (e.g. only allow 100 open files). > > A HardenedBSD user has reported an issue with this commit: > > https://twitter.com/0x666c7578/status/982901931969597440 > The mariadb ports should be good with this after ports r466451, tracking PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227205 From owner-svn-src-stable@freebsd.org Mon Apr 9 16:10:10 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E28EF8BD91; Mon, 9 Apr 2018 16:10:10 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-lf0-f41.google.com (mail-lf0-f41.google.com [209.85.215.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 70B2B7603A; Mon, 9 Apr 2018 16:10:09 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-lf0-f41.google.com with SMTP id m200-v6so7381860lfm.4; Mon, 09 Apr 2018 09:10:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=V1k5M3IzMOcDcP7hplQt9EJnvkDe/G7uDiDmQ9VqB8o=; b=Jov5uyWnHVTjtNCQWf8WWeQfn7I8DPkKWK8CFaWfw6Te6c5MeiWLsjJwRaFMJ7ivIA aNTI2PLgnuPaJ9JoNb/X9H6XBIq+sAgP83IlvnSs4T97HHKguBrTbTkare6Wspxw6hnN smN6lQuc2ETX9wpt6yfgujrKq9dUUp99rG0q3ApS2XSlYoB3KfttOSIi57aZN/vuPGCw 9aXRhDHyR/8htBgA1BFyT6ktTfMflO4GzjEZ5vmJKn+kXhNuopWhpMOgx7Knix8sURxQ iaRWqGFvLKLDBKkACJGQU3LdWQgUW135xq0G4k1Li3imlhp5L1XA6Bmc25CJ1pqo/mfY Fs9w== X-Gm-Message-State: AElRT7Hp66BJSWvMavt28vLVYmVKpM7h7qFo6VRtazhJZmF+OnyK6UgT +irCZ8X5tVFlRRttFkIGRr4iHbgL X-Google-Smtp-Source: AIpwx4/64mYgxj0K0efYlgJHvweMDdrlxingsQSg2NaUn5AJydn4DBKg3B6tLoTTaZOJdXEqTZHgbA== X-Received: by 10.46.154.71 with SMTP id k7mr22680759ljj.42.1523290207211; Mon, 09 Apr 2018 09:10:07 -0700 (PDT) Received: from mail-lf0-f44.google.com (mail-lf0-f44.google.com. [209.85.215.44]) by smtp.gmail.com with ESMTPSA id r6sm124184ljh.55.2018.04.09.09.10.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Apr 2018 09:10:07 -0700 (PDT) Received: by mail-lf0-f44.google.com with SMTP id c78-v6so7372242lfh.1; Mon, 09 Apr 2018 09:10:07 -0700 (PDT) X-Received: by 2002:a19:c4c8:: with SMTP id u191-v6mr23216084lff.109.1523290206852; Mon, 09 Apr 2018 09:10:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.129.90 with HTTP; Mon, 9 Apr 2018 09:09:46 -0700 (PDT) In-Reply-To: <201804091552.w39Fqv2S019416@pdx.rh.CN85.dnsmgr.net> References: <201804091552.w39Fqv2S019416@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Mon, 9 Apr 2018 11:09:46 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r331880 - stable/11/etc To: "Rodney W. Grimes" Cc: Niclas Zeising , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 16:10:10 -0000 On Mon, Apr 9, 2018 at 10:52 AM, Rodney W. Grimes wrote: >> On Mon, Apr 9, 2018 at 10:30 AM, Rodney W. Grimes >> wrote: >> >> On Mon, Apr 9, 2018 at 10:14 AM, Rodney W. Grimes >> >> wrote: >> >> >> On Mon, Apr 9, 2018 at 9:46 AM, Rodney W. Grimes >> >> >> wrote: >> >> >> >> On 04/02/18 17:39, Rodney W. Grimes wrote: >> >> >> >> >> Author: kevans >> >> >> >> >> Date: Mon Apr 2 15:28:48 2018 >> >> >> >> >> New Revision: 331880 >> >> >> >> >> URL: https://svnweb.freebsd.org/changeset/base/331880 >> >> >> >> >> >> >> >> >> >> Log: >> >> >> >> >> MFC r328331: Support configuring arbitrary limits(1) for any rc.conf daemon >> >> >> >> >> >> >> >> >> >> Usage is ${name}_limits, and the argument is any flags accepted by >> >> >> >> >> limits(1), such as `-n 100' (e.g. only allow 100 open files). >> >> >> >> >> >> >> >> >> >> Modified: >> >> >> >> >> stable/11/etc/rc.subr >> >> >> >> >> Directory Properties: >> >> >> >> >> stable/11/ (props changed) >> >> >> >> >> >> >> >> >> >> Modified: stable/11/etc/rc.subr >> >> >> >> >> ============================================================================== >> >> >> >> >> --- stable/11/etc/rc.subr Mon Apr 2 15:07:41 2018 (r331879) >> >> >> >> >> +++ stable/11/etc/rc.subr Mon Apr 2 15:28:48 2018 (r331880) >> >> >> >> >> @@ -773,6 +773,8 @@ check_startmsgs() >> >> >> >> >> # >> >> >> >> >> # ${name}_login_class n Login class to use, else "daemon". >> >> >> >> >> # >> >> >> >> >> +# ${name}_limits n limits(1) to apply to ${command}. >> >> >> >> >> +# >> >> >> >> > >> >> >> >> > Caution, limits(1) is in /usr/bin, this code can fail if used before >> >> >> >> > /usr is mounted. (Ie, our rc.initdiskless) is probably broken by >> >> >> >> > this change if a call is made to limits. >> >> >> >> > >> >> >> >> > >> >> >> >> >> >> >> >> Sorry for jumping on this so late. This is also an issue in CURRENT, >> >> >> >> and has been since at least 2016. >> >> >> > >> >> >> > I was aware that it was an issue and why I made a comment about it >> >> >> > being MFC'ed. Though I had forgot a bug report existed. >> >> >> >> >> >> I'm kind of surprised we haven't had more complaints about this- the >> >> >> original commit for this stuff landed before stable/11 was even >> >> >> branched, so it's been broken for all of 11.x's lifetime. >> >> > >> >> > History has taught me it takes a long time for this type of >> >> > breakage to usually surface in a noticable way. Also I think >> >> > until you merged this last ${name}_limits thing it actually >> >> > didn't cause an issue, except for the few like me running >> >> > diskless systems and or seperate /usr. >> >> >> >> I don't see how this merge could possibly have been the cause of any >> >> claimed issues- like I said before, it didn't add any limits >> >> invocations, it added an arg to the limits invocation that already >> >> existed. You can see this pretty clearly from the diff, we didn't even >> >> change any conditions for limits to be invoked. >> > >> > limits_mysql="NO" is defined by the startup script for mysql, >> > that now causes /etc/rc to try and use that variable in a >> > different way. >> > >> > You added a variable, one that was already in use by some other >> > /etc/rc* related component. Collision of differening uses is >> > causing errors. >> > >> >> Ah, apologies, I misread your previous e-mail and had interpreted it >> as you claiming again that this broke things for those of you "running >> diskless systems and or seperate /usr." -- this other breakage, these >> are things we can fix and aren't really large hurdles to climb over. > > Mostly true, other than the hurdle of that 0mp mentions in his > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227205 > We need to remember that we cannot simply switch to > the new mechanism as it is only available in 12-CURRENT > and soon in 11-STABLE (and 11.2). > > I am not sure how to handle that with the users, it is a operational > interface change in how limits are done for these ports and probably > is going to break a lot of peoples systems if they try to update > from 11.1 to 11.2 because there /etc/rc.conf file is full of old > stuff that this new stuff is incompatible with. > > IMHO, it would be best to post pone this change to 12, as people > are more willing to suffer painful upgrades when going between > major versions. > Right- so, back out this MFC (and the subsequent FreeBSD_version bump) and fix the ports to do the right thing for 12.x while that's still not a technically supported branch? >> >> We just need people like 0mp that are actually inclined to address it >> in ports, and we need to actually communicate changes like this with >> ports people and assess what's going to break and make a plan to get >> it fixed. > > Problem was/is no one had the foresight to see the ports breakage > coming and avoid it in some way. That happens, its engineering, > lets find a fix and move on. > >> IMO this in particular wasn't a major change, and it shouldn't have >> been too big of a deal (unlike the commit that it built upon). I don't >> think it should've been broken in head for two months in the various >> ports that 0mp has identified- even if people don't run these >> databases on head, we should've assessed the fallout and fixed it >> somewhere in the two month's time. We're not talking half the ports >> tree, we're talking < 30 ports. =( > > Its usually the tiny, minor, itty bit little nit change that bites > the hardest :-) > From owner-svn-src-stable@freebsd.org Mon Apr 9 16:18:03 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13F69F8C5E9; Mon, 9 Apr 2018 16:18:03 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B8F2F7A530; Mon, 9 Apr 2018 16:18:02 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB15920FD2; Mon, 9 Apr 2018 16:18:02 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w39GI2XL015238; Mon, 9 Apr 2018 16:18:02 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39GI2Zi015237; Mon, 9 Apr 2018 16:18:02 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804091618.w39GI2Zi015237@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 9 Apr 2018 16:18:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332331 - stable/11/sys/dev/wl X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/11/sys/dev/wl X-SVN-Commit-Revision: 332331 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 16:18:03 -0000 Author: brooks Date: Mon Apr 9 16:18:02 2018 New Revision: 332331 URL: https://svnweb.freebsd.org/changeset/base/332331 Log: Fix wl(4) after r332288. I missed that this was an assignment (a bad pattern, use another member) on i386. As wl(4) is i386 only and gone in head, just expand the ifr_ifru member rather than adding an accessor. Reported by: gjb Modified: stable/11/sys/dev/wl/if_wl.c Modified: stable/11/sys/dev/wl/if_wl.c ============================================================================== --- stable/11/sys/dev/wl/if_wl.c Mon Apr 9 15:29:14 2018 (r332330) +++ stable/11/sys/dev/wl/if_wl.c Mon Apr 9 16:18:02 2018 (r332331) @@ -1357,7 +1357,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data) /* get the current NWID out of the sc since we stored it there */ case SIOCGWLCNWID: WL_LOCK(sc); - ifr_data_get_ptr(ifr) = (caddr_t) (sc->nwid[0] << 8 | sc->nwid[1]); + ifr->ifr_ifru.ifru_data = (caddr_t) (sc->nwid[0] << 8 | sc->nwid[1]); WL_UNLOCK(sc); break; From owner-svn-src-stable@freebsd.org Mon Apr 9 16:19:13 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49F42F8C6D3; Mon, 9 Apr 2018 16:19:13 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D17CF7AFD2; Mon, 9 Apr 2018 16:19:12 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id E3FC65A9F12; Mon, 9 Apr 2018 16:19:11 +0000 (UTC) Date: Mon, 9 Apr 2018 16:19:11 +0000 From: Brooks Davis To: Glen Barber Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r332288 - in stable/11/sys: dev/an dev/ath dev/cxgbe dev/de dev/en dev/fatm dev/hatm dev/if_ndis dev/iwi dev/ixgbe dev/ixl dev/mlx4/mlx4_en dev/mlx5/mlx5_en dev/mwl dev/nxge dev/oce dev... Message-ID: <20180409161911.GC3560@spindle.one-eyed-alien.net> References: <201804081654.w38Gs7JY007779@repo.freebsd.org> <20180409135849.GA84067@FreeBSD.org> <20180409153250.GB3560@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1LKvkjL3sHcu1TtY" Content-Disposition: inline In-Reply-To: <20180409153250.GB3560@spindle.one-eyed-alien.net> User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 16:19:13 -0000 --1LKvkjL3sHcu1TtY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 09, 2018 at 03:32:50PM +0000, Brooks Davis wrote: > On Mon, Apr 09, 2018 at 01:58:49PM +0000, Glen Barber wrote: > > On Sun, Apr 08, 2018 at 04:54:07PM +0000, Brooks Davis wrote: > > > Author: brooks > > > Date: Sun Apr 8 16:54:07 2018 > > > New Revision: 332288 > > > URL: https://svnweb.freebsd.org/changeset/base/332288 > > >=20 > > > Log: > > > MFC r331797: > > > =20 > > > Use an accessor function to access ifr_data. > > > =20 > > > This fixes 32-bit compat (no ioctl command defintions are required > > > as struct ifreq is the same size). > > > =20 > > > Reviewed by: kib > > > Obtained from: CheriBSD > > > Sponsored by: DARPA, AFRL > > > Differential Revision: https://reviews.freebsd.org/D14900 > > >=20 > > > Modified: > > [...] > > > stable/11/sys/dev/wl/if_wl.c > >=20 > > > Directory Properties: > > > stable/11/ (props changed) > > >=20 > > [...] > > > Modified: stable/11/sys/dev/wl/if_wl.c > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > > --- stable/11/sys/dev/wl/if_wl.c Sun Apr 8 16:46:24 2018 (r332287) > > > +++ stable/11/sys/dev/wl/if_wl.c Sun Apr 8 16:54:07 2018 (r332288) > > > @@ -1313,7 +1313,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t = data) > > > } > > > WL_UNLOCK(sc); > > > =20 > > > - error =3D copyout(psa_buf, ifr->ifr_data, sizeof(psa_buf)); > > > + error =3D copyout(psa_buf, ifr_data_get_ptr(ifr), sizeof(psa_buf)); > > > break; > > > =20 > > > =20 > > > @@ -1323,7 +1323,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t = data) > > > if ((error =3D priv_check(td, PRIV_DRIVER))) > > > break; > > > =20 > > > - error =3D copyin(ifr->ifr_data, psa_buf, sizeof(psa_buf)); > > > + error =3D copyin(ifr_data_get_ptr(ifr), psa_buf, sizeof(psa_buf)); > > > if (error) > > > break; > > > =09 > > > @@ -1357,7 +1357,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t = data) > > > /* get the current NWID out of the sc since we stored it there */ > > > case SIOCGWLCNWID: > > > WL_LOCK(sc); > > > - ifr->ifr_data =3D (caddr_t) (sc->nwid[0] << 8 | sc->nwid[1]); > > > + ifr_data_get_ptr(ifr) =3D (caddr_t) (sc->nwid[0] << 8 | sc->nwid[1]= ); > > > WL_UNLOCK(sc); > > > break; > > > =20 > >=20 > > This part of the change appears to have broken i386 with the following: >=20 > Sorry about this, will fix shortly. Fixed in r332331. -- Brooks --1LKvkjL3sHcu1TtY Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJay5J/AAoJEKzQXbSebgfAT4gH/1dY7yDxUyfscJ9TrUuianVi usazJ9LnZvvm85ONAW//7fwAmllrp5yKMt/+h3RffUyvcC3jWJHC5m7kBy2+6ECl qoVwuB/nkgFyS8ReT834ntt4DkLyjMI/QiAY7RuUFOy+CRzvbeDl0Z/hbMDm2SaS eARgvStpE3tc8qllzYhDr+jIKjRyCYxyLitM7erdHer6dRI79OTXOhDhZx96mYIM V3ET1R4ltUY8pp2/eii+pJ4+qjw7PHerij4+kKfrcc5/20qEGGedjIaSyG+10tQa GXFxVDfjbM5KxE3yBCbSPkZNnbH+43VmtiPjYzVCHJHCBTdtIYBZE37IU1HRFRw= =RbjH -----END PGP SIGNATURE----- --1LKvkjL3sHcu1TtY-- From owner-svn-src-stable@freebsd.org Mon Apr 9 16:25:45 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6EC9F8CD2B for ; Mon, 9 Apr 2018 16:25:45 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B6C87EA2C; Mon, 9 Apr 2018 16:25:43 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w39GPXaA019558; Mon, 9 Apr 2018 09:25:33 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w39GPXpK019557; Mon, 9 Apr 2018 09:25:33 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804091625.w39GPXpK019557@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r331880 - stable/11/etc In-Reply-To: To: Kyle Evans Date: Mon, 9 Apr 2018 09:25:33 -0700 (PDT) CC: "Rodney W. Grimes" , Niclas Zeising , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , svn-src-stable-11@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 16:25:45 -0000 [ Charset UTF-8 unsupported, converting... ] > On Mon, Apr 9, 2018 at 10:52 AM, Rodney W. Grimes > wrote: > >> On Mon, Apr 9, 2018 at 10:30 AM, Rodney W. Grimes > >> wrote: > >> >> On Mon, Apr 9, 2018 at 10:14 AM, Rodney W. Grimes > >> >> wrote: > >> >> >> On Mon, Apr 9, 2018 at 9:46 AM, Rodney W. Grimes > >> >> >> wrote: > >> >> >> >> On 04/02/18 17:39, Rodney W. Grimes wrote: > >> >> >> >> >> Author: kevans > >> >> >> >> >> Date: Mon Apr 2 15:28:48 2018 > >> >> >> >> >> New Revision: 331880 > >> >> >> >> >> URL: https://svnweb.freebsd.org/changeset/base/331880 > >> >> >> >> >> > >> >> >> >> >> Log: > >> >> >> >> >> MFC r328331: Support configuring arbitrary limits(1) for any rc.conf daemon > >> >> >> >> >> > >> >> >> >> >> Usage is ${name}_limits, and the argument is any flags accepted by > >> >> >> >> >> limits(1), such as `-n 100' (e.g. only allow 100 open files). > >> >> >> >> >> > >> >> >> >> >> Modified: > >> >> >> >> >> stable/11/etc/rc.subr > >> >> >> >> >> Directory Properties: > >> >> >> >> >> stable/11/ (props changed) > >> >> >> >> >> > >> >> >> >> >> Modified: stable/11/etc/rc.subr > >> >> >> >> >> ============================================================================== > >> >> >> >> >> --- stable/11/etc/rc.subr Mon Apr 2 15:07:41 2018 (r331879) > >> >> >> >> >> +++ stable/11/etc/rc.subr Mon Apr 2 15:28:48 2018 (r331880) > >> >> >> >> >> @@ -773,6 +773,8 @@ check_startmsgs() > >> >> >> >> >> # > >> >> >> >> >> # ${name}_login_class n Login class to use, else "daemon". > >> >> >> >> >> # > >> >> >> >> >> +# ${name}_limits n limits(1) to apply to ${command}. > >> >> >> >> >> +# > >> >> >> >> > > >> >> >> >> > Caution, limits(1) is in /usr/bin, this code can fail if used before > >> >> >> >> > /usr is mounted. (Ie, our rc.initdiskless) is probably broken by > >> >> >> >> > this change if a call is made to limits. > >> >> >> >> > > >> >> >> >> > > >> >> >> >> > >> >> >> >> Sorry for jumping on this so late. This is also an issue in CURRENT, > >> >> >> >> and has been since at least 2016. > >> >> >> > > >> >> >> > I was aware that it was an issue and why I made a comment about it > >> >> >> > being MFC'ed. Though I had forgot a bug report existed. > >> >> >> > >> >> >> I'm kind of surprised we haven't had more complaints about this- the > >> >> >> original commit for this stuff landed before stable/11 was even > >> >> >> branched, so it's been broken for all of 11.x's lifetime. > >> >> > > >> >> > History has taught me it takes a long time for this type of > >> >> > breakage to usually surface in a noticable way. Also I think > >> >> > until you merged this last ${name}_limits thing it actually > >> >> > didn't cause an issue, except for the few like me running > >> >> > diskless systems and or seperate /usr. > >> >> > >> >> I don't see how this merge could possibly have been the cause of any > >> >> claimed issues- like I said before, it didn't add any limits > >> >> invocations, it added an arg to the limits invocation that already > >> >> existed. You can see this pretty clearly from the diff, we didn't even > >> >> change any conditions for limits to be invoked. > >> > > >> > limits_mysql="NO" is defined by the startup script for mysql, > >> > that now causes /etc/rc to try and use that variable in a > >> > different way. > >> > > >> > You added a variable, one that was already in use by some other > >> > /etc/rc* related component. Collision of differening uses is > >> > causing errors. > >> > > >> > >> Ah, apologies, I misread your previous e-mail and had interpreted it > >> as you claiming again that this broke things for those of you "running > >> diskless systems and or seperate /usr." -- this other breakage, these > >> are things we can fix and aren't really large hurdles to climb over. > > > > Mostly true, other than the hurdle of that 0mp mentions in his > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227205 > > We need to remember that we cannot simply switch to > > the new mechanism as it is only available in 12-CURRENT > > and soon in 11-STABLE (and 11.2). > > > > I am not sure how to handle that with the users, it is a operational > > interface change in how limits are done for these ports and probably > > is going to break a lot of peoples systems if they try to update > > from 11.1 to 11.2 because there /etc/rc.conf file is full of old > > stuff that this new stuff is incompatible with. > > > > IMHO, it would be best to post pone this change to 12, as people > > are more willing to suffer painful upgrades when going between > > major versions. > > > > Right- so, back out this MFC (and the subsequent FreeBSD_version bump) > and fix the ports to do the right thing for 12.x while that's still > not a technically supported branch? I think that might be the easiest path forward. Not sure if you can back out the version bump, maybe move it forward another notch, leaving a narrow window of when this existed, and no one should have to deal with that window hopefuly. You may want to wait for input from 0mp. > >> We just need people like 0mp that are actually inclined to address it > >> in ports, and we need to actually communicate changes like this with > >> ports people and assess what's going to break and make a plan to get > >> it fixed. > > > > Problem was/is no one had the foresight to see the ports breakage > > coming and avoid it in some way. That happens, its engineering, > > lets find a fix and move on. > > > >> IMO this in particular wasn't a major change, and it shouldn't have > >> been too big of a deal (unlike the commit that it built upon). I don't > >> think it should've been broken in head for two months in the various > >> ports that 0mp has identified- even if people don't run these > >> databases on head, we should've assessed the fallout and fixed it > >> somewhere in the two month's time. We're not talking half the ports > >> tree, we're talking < 30 ports. =( > > > > Its usually the tiny, minor, itty bit little nit change that bites > > the hardest :-) > > > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-stable@freebsd.org Mon Apr 9 16:25:49 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0373F8CD45; Mon, 9 Apr 2018 16:25:48 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 92ED37EAFD; Mon, 9 Apr 2018 16:25:47 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id C80F41981B; Mon, 9 Apr 2018 16:25:45 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Mon, 9 Apr 2018 16:25:43 +0000 From: Glen Barber To: Brooks Davis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r332288 - in stable/11/sys: dev/an dev/ath dev/cxgbe dev/de dev/en dev/fatm dev/hatm dev/if_ndis dev/iwi dev/ixgbe dev/ixl dev/mlx4/mlx4_en dev/mlx5/mlx5_en dev/mwl dev/nxge dev/oce dev... Message-ID: <20180409162543.GE33065@FreeBSD.org> References: <201804081654.w38Gs7JY007779@repo.freebsd.org> <20180409135849.GA84067@FreeBSD.org> <20180409153250.GB3560@spindle.one-eyed-alien.net> <20180409161911.GC3560@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="b5gNqxB1S1yM7hjW" Content-Disposition: inline In-Reply-To: <20180409161911.GC3560@spindle.one-eyed-alien.net> User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 16:25:49 -0000 --b5gNqxB1S1yM7hjW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 09, 2018 at 04:19:11PM +0000, Brooks Davis wrote: > On Mon, Apr 09, 2018 at 03:32:50PM +0000, Brooks Davis wrote: > > On Mon, Apr 09, 2018 at 01:58:49PM +0000, Glen Barber wrote: > > > On Sun, Apr 08, 2018 at 04:54:07PM +0000, Brooks Davis wrote: > > > > Author: brooks > > > > Date: Sun Apr 8 16:54:07 2018 > > > > New Revision: 332288 > > > > URL: https://svnweb.freebsd.org/changeset/base/332288 > > > >=20 > > > > Log: > > > > MFC r331797: > > > > =20 > > > > Use an accessor function to access ifr_data. > > > > =20 > > > > This fixes 32-bit compat (no ioctl command defintions are required > > > > as struct ifreq is the same size). > > > > =20 > > > > Reviewed by: kib > > > > Obtained from: CheriBSD > > > > Sponsored by: DARPA, AFRL > > > > Differential Revision: https://reviews.freebsd.org/D14900 > > > >=20 > > > > Modified: > > > [...] > > > > stable/11/sys/dev/wl/if_wl.c > > >=20 > > > > Directory Properties: > > > > stable/11/ (props changed) > > > >=20 > > > [...] > > > > Modified: stable/11/sys/dev/wl/if_wl.c > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > > > > --- stable/11/sys/dev/wl/if_wl.c Sun Apr 8 16:46:24 2018 (r332287) > > > > +++ stable/11/sys/dev/wl/if_wl.c Sun Apr 8 16:54:07 2018 (r332288) > > > > @@ -1313,7 +1313,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_= t data) > > > > } > > > > WL_UNLOCK(sc); > > > > =20 > > > > - error =3D copyout(psa_buf, ifr->ifr_data, sizeof(psa_buf)); > > > > + error =3D copyout(psa_buf, ifr_data_get_ptr(ifr), sizeof(psa_buf)= ); > > > > break; > > > > =20 > > > > =20 > > > > @@ -1323,7 +1323,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_= t data) > > > > if ((error =3D priv_check(td, PRIV_DRIVER))) > > > > break; > > > > =20 > > > > - error =3D copyin(ifr->ifr_data, psa_buf, sizeof(psa_buf)); > > > > + error =3D copyin(ifr_data_get_ptr(ifr), psa_buf, sizeof(psa_buf)); > > > > if (error) > > > > break; > > > > =09 > > > > @@ -1357,7 +1357,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_= t data) > > > > /* get the current NWID out of the sc since we stored it there */ > > > > case SIOCGWLCNWID: > > > > WL_LOCK(sc); > > > > - ifr->ifr_data =3D (caddr_t) (sc->nwid[0] << 8 | sc->nwid[1]); > > > > + ifr_data_get_ptr(ifr) =3D (caddr_t) (sc->nwid[0] << 8 | sc->nwid[= 1]); > > > > WL_UNLOCK(sc); > > > > break; > > > > =20 > > >=20 > > > This part of the change appears to have broken i386 with the followin= g: > >=20 > > Sorry about this, will fix shortly. >=20 > Fixed in r332331. >=20 Thank you. Glen --b5gNqxB1S1yM7hjW Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEjRJAPC5sqwhs9k2jAxRYpUeP4pMFAlrLlAcACgkQAxRYpUeP 4pPOFg/8C8YQzraWFW75rkAi3pyXmDc9lGX0sJdSDPLMMzzdFiAB5Ngp/99sb657 Ub+UkquTBBy+s8LSxxirM+iQPD5T95Cu0D2QmGlTgi4RK4DKXUqAvP7p3ChBvI8q GHnKbtZp2QAaagt/geqaCBekyuuRwbQJS374goE4c8u7UOpDlWQffaUL95MGvdq/ aiTz7ojTiWe4cFWN3uYo1+1Q5LQpR2VAIaGsILuye/L79iUOnrCOs5+qoTojFPOB RfDR3aVgb/EG3pJMTlUY27Bv2Gym58sNRo4qIkWtN2SFPqftPAL2OGPKXPXOQ8YO RohTM78hhMhjGrUyvgOpODhXsn3uGZY5MxH0mXckZNtahrJP14G/ZAEEyRVGO7cV 02EDEOJziuxE+jgDu4b2VRSnPDi8aOrhyc/8v8G01LVEaRxmXiFH9Ywur/dUqmrf HTWEtgrDQozqFVSlvDiGQkwEue5y3fNANsLiP8GCAJnzDp7PmubgaRZ51jgOFpyF Hnxdt3I8HN/rLzZHh3qenI64nDN7qntrf3vDqFQ+0npa3LZyX/t1RMWopwY9j7Ye LYn0uB9OsLct1HV/n0VMd1UfSl3xAWAMTHVsOT1/J+u8n+Z/TdfAnnekiN1rD81o 3CSGjF2XImOqni+KpF5s81oEnRGHrWT2u+36WD13rKUl0yVHuww= =ZLUi -----END PGP SIGNATURE----- --b5gNqxB1S1yM7hjW-- From owner-svn-src-stable@freebsd.org Mon Apr 9 16:32:49 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1918F8D510; Mon, 9 Apr 2018 16:32:49 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 81A61828D0; Mon, 9 Apr 2018 16:32:49 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 784272130B; Mon, 9 Apr 2018 16:32:49 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w39GWna2024736; Mon, 9 Apr 2018 16:32:49 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39GWnui024735; Mon, 9 Apr 2018 16:32:49 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804091632.w39GWnui024735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 9 Apr 2018 16:32:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332332 - stable/10/sys/net X-SVN-Group: stable-10 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/10/sys/net X-SVN-Commit-Revision: 332332 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 16:32:50 -0000 Author: brooks Date: Mon Apr 9 16:32:49 2018 New Revision: 332332 URL: https://svnweb.freebsd.org/changeset/base/332332 Log: MFC r332151: ifconf(): correct handling of sockaddrs smaller than struct sockaddr. Portable programs that use SIOCGIFCONF (e.g. traceroute) assume that each pseudo ifreq is of length MAX(sizeof(struct ifreq), sizeof(ifr_name) + ifr_addr.sa_len). For short sockaddrs we copied too much from the source sockaddr resulting in a heap leak. I believe only one such sockaddr exists (struct sockaddr_sco which is 8 bytes) and it is unclear if such sockaddrs end up on interfaces in practice. If it did, the result would be an 8 byte heap leak on current architectures. admbugs: 869 Reviewed by: kib Obtained from: CheriBSD Security: kernel heap leak Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14981 Modified: stable/10/sys/net/if.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/if.c ============================================================================== --- stable/10/sys/net/if.c Mon Apr 9 16:18:02 2018 (r332331) +++ stable/10/sys/net/if.c Mon Apr 9 16:32:49 2018 (r332332) @@ -3055,7 +3055,13 @@ again: } else #endif if (sa->sa_len <= sizeof(*sa)) { - ifr.ifr_addr = *sa; + if (sa->sa_len < sizeof(*sa)) { + memset(&ifr.ifr_ifru.ifru_addr, 0, + sizeof(ifr.ifr_ifru.ifru_addr)); + memcpy(&ifr.ifr_ifru.ifru_addr, sa, + sa->sa_len); + } else + ifr.ifr_ifru.ifru_addr = *sa; sbuf_bcat(sb, &ifr, sizeof(ifr)); max_len += sizeof(ifr); } else { From owner-svn-src-stable@freebsd.org Mon Apr 9 16:59:35 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FBA4F8EF2F for ; Mon, 9 Apr 2018 16:59:35 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22e.google.com (mail-it0-x22e.google.com [IPv6:2607:f8b0:4001:c0b::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45F767155C for ; Mon, 9 Apr 2018 16:59:34 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22e.google.com with SMTP id x144-v6so12289594itc.0 for ; Mon, 09 Apr 2018 09:59:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=FS5t4Hf99CLVYaQUF66oF0XeEDsc4EWc0ox6lLX1tyc=; b=Hz67eeGdXvI6Bvvqt0WBErW4g6HePlKiFjZngxE2BiOWuO23UOdGA7rRcgQQHZjWMr zaBQqrK8Rvnbs32OYaawJZnEw6Y/k91b+j4SCB/lw5rW7KMNra83dpRquB/0kusyvTo4 q7kYyM/G00l6Q69N+jNRvZ9CWCPXchCYpcTiE2ecoGZA6iM/8IDzAIX8DDrYcNN/5eYS oveXatxZluslDRS7HvHSht32vRh4VOcGG1scks7tVyGeAN7UpCHTzV6E5NrHKHrZeAV3 mKVXKIyRchXQ7CtuFOZ0S3NbmuMpSR37FSI1lqHunoIhH5vcZsszLGGU+wn5nLBwOfjr HfvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=FS5t4Hf99CLVYaQUF66oF0XeEDsc4EWc0ox6lLX1tyc=; b=t2Gr7JGe7WLXl9ScSkDZVLWNVo6XWagNgh6s74/PxZIvEulx6hiuV2VnK2wh+R0Xai ConTs+ekIvr4sJsQvgch5etPDFzwEfPq5RytNJzluPSkjoOgHye2KAMqwEku30u1lN3E Dum5eLoqe7BvXhejDYUnqxB4FEv3yPb2kHoucOGM2u9az+jcA/O/0xV4Se9gQ9DI59Ue UVulJjzXOjJCHnHMN+y7DU08peOchM3X3vwLfB3skTQgXl7/faBDzU+uyzh2thcLbAZT IV9MrJF8WHUeofDssgnd6eBXReDpqjd5boy4uSHi4mT7S1kfCn1cs6sxYrb4gIv29tJh IFVw== X-Gm-Message-State: ALQs6tDYCs2fLSt8UPZQ2V7csM108E0sep5MUVfTdt38Sjt8qJTIQ7Wi WmhuTCgqUEk51KV7TVIIDsQwetyAAtotnGpW/10EIA== X-Google-Smtp-Source: AIpwx4/SE27738y6Jp4RQUC20GVmLCtaDxHMYq/hbaqx0JeJ5u0hcAqTfGZ4K7h5OqAGJNkGUZ5vB5qcS2asIfbveco= X-Received: by 2002:a24:b649:: with SMTP id d9-v6mr866731itj.51.1523293173298; Mon, 09 Apr 2018 09:59:33 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.228.135 with HTTP; Mon, 9 Apr 2018 09:59:32 -0700 (PDT) X-Originating-IP: [50.227.106.226] In-Reply-To: References: <201804091552.w39Fqv2S019416@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Mon, 9 Apr 2018 10:59:32 -0600 X-Google-Sender-Auth: wCbUoe9fjUTxxBpkGTwJgWm1pzs Message-ID: Subject: Re: svn commit: r331880 - stable/11/etc To: Kyle Evans Cc: "Rodney W. Grimes" , Niclas Zeising , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 16:59:35 -0000 On Mon, Apr 9, 2018 at 10:09 AM, Kyle Evans wrote: > Right- so, back out this MFC (and the subsequent FreeBSD_version bump) > and fix the ports to do the right thing for 12.x while that's still > not a technically supported branch? Don't back out the version bump. Other things may be riding along on it 'for free'. Better to bump it again when you unMFC (if it's been more than a few days since we've had one), and then yet-again when a fixed MFC happens. Unless there's something you can ride along on for free :) Otherwise, that's a great plan. Warner From owner-svn-src-stable@freebsd.org Mon Apr 9 17:09:11 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81BB3F8F96B; Mon, 9 Apr 2018 17:09:11 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1519B76B23; Mon, 9 Apr 2018 17:09:11 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1f5ZfJ-000OAM-6T; Mon, 09 Apr 2018 19:29:09 +0300 Date: Mon, 9 Apr 2018 19:29:09 +0300 From: Slawa Olhovchenkov To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r332091 - stable/11/sys/vm Message-ID: <20180409162909.GF6612@zxy.spb.ru> References: <201804060925.w369P8c2019558@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201804060925.w369P8c2019558@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 17:09:11 -0000 On Fri, Apr 06, 2018 at 09:25:08AM +0000, Konstantin Belousov wrote: > Author: kib > Date: Fri Apr 6 09:25:08 2018 > New Revision: 332091 > URL: https://svnweb.freebsd.org/changeset/base/332091 > > Log: > MFC r331760: > Make vm_map_max/min/pmap KBI stable. > > Modified: > stable/11/sys/vm/vm_map.c > stable/11/sys/vm/vm_map.h > Directory Properties: > stable/11/ (props changed) -STABLE still crashed after load vboxnet build on 11.1-RELEASE nvidia (build on 11.1-RELEASE) also don't work From owner-svn-src-stable@freebsd.org Mon Apr 9 20:00:08 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1221F9EB15; Mon, 9 Apr 2018 20:00:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E8F77071E; Mon, 9 Apr 2018 20:00:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 996DB23422; Mon, 9 Apr 2018 20:00:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w39K07UQ032269; Mon, 9 Apr 2018 20:00:07 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39K07X4032268; Mon, 9 Apr 2018 20:00:07 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804092000.w39K07X4032268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 9 Apr 2018 20:00:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332336 - stable/11/contrib/dma X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/contrib/dma X-SVN-Commit-Revision: 332336 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 20:00:08 -0000 Author: emaste Date: Mon Apr 9 20:00:07 2018 New Revision: 332336 URL: https://svnweb.freebsd.org/changeset/base/332336 Log: MFC r326641 by bapt: Split body of mails not respecting RFC2822 For mails which has a body not respecting RFC2822 (which often happen with crontabs) try to split by words finding the last space before 1000's character If no spaces are found then consider the mail to be malformed anyway PR: 208261 Modified: stable/11/contrib/dma/mail.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/dma/mail.c ============================================================================== --- stable/11/contrib/dma/mail.c Mon Apr 9 19:11:24 2018 (r332335) +++ stable/11/contrib/dma/mail.c Mon Apr 9 20:00:07 2018 (r332336) @@ -41,6 +41,8 @@ #include "dma.h" +#define MAX_LINE_RFC822 1000 + void bounce(struct qitem *it, const char *reason) { @@ -341,19 +343,47 @@ newaddr: goto again; } +static int +writeline(struct queue *queue, const char *line, ssize_t linelen) +{ + ssize_t len; + + while (linelen > 0) { + len = linelen; + if (linelen > MAX_LINE_RFC822) { + len = MAX_LINE_RFC822 - 10; + } + + if (fwrite(line, len, 1, queue->mailf) != 1) + return (-1); + + if (linelen <= MAX_LINE_RFC822) + break; + + if (fwrite("\n", 1, 1, queue->mailf) != 1) + return (-1); + + line += MAX_LINE_RFC822 - 10; + linelen = strlen(line); + } + return (0); +} + int readmail(struct queue *queue, int nodot, int recp_from_header) { struct parse_state parse_state; - char line[1000]; /* by RFC2822 */ - size_t linelen; + char *line = NULL; + ssize_t linelen; + size_t linecap = 0; + char newline[MAX_LINE_RFC822]; size_t error; int had_headers = 0; int had_from = 0; int had_messagid = 0; int had_date = 0; - int had_last_line = 0; int nocopy = 0; + int ret = -1; parse_state.state = NONE; @@ -372,24 +402,17 @@ readmail(struct queue *queue, int nodot, int recp_from return (-1); while (!feof(stdin)) { - if (fgets(line, sizeof(line) - 1, stdin) == NULL) + newline[0] = '\0'; + if ((linelen = getline(&line, &linecap, stdin)) <= 0) break; - if (had_last_line) - errlogx(EX_DATAERR, "bad mail input format:" - " from %s (uid %d) (envelope-from %s)", - username, useruid, queue->sender); - linelen = strlen(line); - if (linelen == 0 || line[linelen - 1] != '\n') { - /* - * This line did not end with a newline character. - * If we fix it, it better be the last line of - * the file. - */ - line[linelen] = '\n'; - line[linelen + 1] = 0; - had_last_line = 1; - } + if (!had_headers) { + if (linelen > MAX_LINE_RFC822) { + /* XXX also split headers */ + errlogx(EX_DATAERR, "bad mail input format:" + " from %s (uid %d) (envelope-from %s)", + username, useruid, queue->sender); + } /* * Unless this is a continuation, switch of * the Bcc: nocopy flag. @@ -430,31 +453,39 @@ readmail(struct queue *queue, int nodot, int recp_from while (!had_date || !had_messagid || !had_from) { if (!had_date) { had_date = 1; - snprintf(line, sizeof(line), "Date: %s\n", rfc822date()); + snprintf(newline, sizeof(newline), "Date: %s\n", rfc822date()); } else if (!had_messagid) { /* XXX msgid, assign earlier and log? */ had_messagid = 1; - snprintf(line, sizeof(line), "Message-Id: <%"PRIxMAX".%s.%"PRIxMAX"@%s>\n", + snprintf(newline, sizeof(newline), "Message-Id: <%"PRIxMAX".%s.%"PRIxMAX"@%s>\n", (uintmax_t)time(NULL), queue->id, (uintmax_t)random(), hostname()); } else if (!had_from) { had_from = 1; - snprintf(line, sizeof(line), "From: <%s>\n", queue->sender); + snprintf(newline, sizeof(newline), "From: <%s>\n", queue->sender); } - if (fwrite(line, strlen(line), 1, queue->mailf) != 1) - return (-1); + if (fwrite(newline, strlen(newline), 1, queue->mailf) != 1) + goto fail; } - strcpy(line, "\n"); + strlcpy(newline, "\n", sizeof(newline)); } if (!nodot && linelen == 2 && line[0] == '.') break; if (!nocopy) { - if (fwrite(line, strlen(line), 1, queue->mailf) != 1) - return (-1); + if (newline[0]) { + if (fwrite(newline, strlen(newline), 1, queue->mailf) != 1) + goto fail; + } else { + if (writeline(queue, line, linelen) != 0) + goto fail; + } } } - return (0); + ret = 0; +fail: + free(line); + return (ret); } From owner-svn-src-stable@freebsd.org Mon Apr 9 21:16:29 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79689FA37C5; Mon, 9 Apr 2018 21:16:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 22EA28467B; Mon, 9 Apr 2018 21:16:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F34B24141; Mon, 9 Apr 2018 21:16:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w39LGSwL072153; Mon, 9 Apr 2018 21:16:28 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39LGSDm072152; Mon, 9 Apr 2018 21:16:28 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804092116.w39LGSDm072152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 9 Apr 2018 21:16:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332337 - stable/11/libexec/dma/dmagent X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/libexec/dma/dmagent X-SVN-Commit-Revision: 332337 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 21:16:29 -0000 Author: emaste Date: Mon Apr 9 21:16:28 2018 New Revision: 332337 URL: https://svnweb.freebsd.org/changeset/base/332337 Log: dmagent: add -D_WITH_GETLINE to fix stable/11 build The need for _WITH_GETLINE and _WITH_DPRINTF was removed in HEAD in r303524 but is still needed in stable/11 to enable prototypes for these functions. Modified: stable/11/libexec/dma/dmagent/Makefile Modified: stable/11/libexec/dma/dmagent/Makefile ============================================================================== --- stable/11/libexec/dma/dmagent/Makefile Mon Apr 9 20:00:07 2018 (r332336) +++ stable/11/libexec/dma/dmagent/Makefile Mon Apr 9 21:16:28 2018 (r332337) @@ -20,6 +20,7 @@ SRCS= aliases_parse.y \ MAN8= dma.8 CONFS= dma.conf CONFSDIR= ${CONFDIR}/dma +CFLAGS+= -D_WITH_GETLINE YFLAGS+= -i CLEANFILES= aliases_parse.i FILES= mailer.conf From owner-svn-src-stable@freebsd.org Mon Apr 9 23:29:21 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 609B1F87A81 for ; Mon, 9 Apr 2018 23:29:21 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-yw0-x229.google.com (mail-yw0-x229.google.com [IPv6:2607:f8b0:4002:c05::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7A9F485347 for ; Mon, 9 Apr 2018 23:29:20 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-yw0-x229.google.com with SMTP id q12so3414661ywj.0 for ; Mon, 09 Apr 2018 16:29:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=15DB257Xt+oZjbKrDa9MBlUzkIygopw131tYfR3WzHs=; b=t4+uOIblZJ2WDJOAa1tNbs7TZt3ACJVLwTrY7e3zjw4bBZhhakskFqNFK5eZOg+d0a 3WGm4+Fj75ynSTlqSSETOrfapc3GBHdB6fr8Q+uVB5g6vSRfNKcpGx/ey+7rWBeY9ymg LM7WhIUOFiu/WMTiIk+q/Q/qeRBo7SMi8NHzATdxRgjB2Jw7RMsHrr5ipEyIg3dzxwBK 1i7bV3gn5R8U1n/Yb0uTO8MQeJXV1Ni0KxGCsoR3nHgsR3szDAy3RBAU8RfeKxXqU/Cn 6b9KBIVx2bzSknPjdyuYP4lGWm8q/VMvofoKyp7K779C+4VjpmHQFo96fyBtzWvsOGQt UHMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=15DB257Xt+oZjbKrDa9MBlUzkIygopw131tYfR3WzHs=; b=ZppjCMI5qe5P4YXKCFCKoKnXJwz9MM+cfakaypY9LCPbcOj58R55dKL1+ntBeYbCWb zydJwZG3A5mxg9EBA2Byv5iHPiD+zrxN6cd0yo30VabHemj+ZWK/lUBgJU4cnDhML81H CKiKAoBlzyr/TPwVO6NQxnxb/aAT6jgKLS6YI4jNmrCMGVfc/KOHNz0Z+xVYL/CWLarf mTiOB4YW/XfXzB1lW1SUOUzUvszetShG402uluawHZBOT4wKLnvjxgiKh9cHv3A4Ha8K PH4r9g6Ac7GHsSxDducT2Db3iEcGkoGv6aYqIXTuzdtSRS2TJjNB7rc4c4FR18UoZM5d Atng== X-Gm-Message-State: ALQs6tAZqQjUd4AAeUguw3Xwa7Ou75QFmf2Bo4is2sp+/JbKB7P+QZHk i91RV7MDSimDc28IwpeKIt6xNEEE1bhVfzB6RGrmlQ== X-Google-Smtp-Source: AIpwx4/3OdqOZEhaUXa7jZ7oJAB3Xh+Dgs9fPG0KAHwnSBl0w5eucVochx0jF0FA3G4yU4Mcv1HKCv4TkKbxh6rY6oE= X-Received: by 10.129.173.25 with SMTP id l25mr12428423ywh.382.1523316559928; Mon, 09 Apr 2018 16:29:19 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ae64:0:0:0:0:0 with HTTP; Mon, 9 Apr 2018 16:29:19 -0700 (PDT) In-Reply-To: References: <201804091552.w39Fqv2S019416@pdx.rh.CN85.dnsmgr.net> From: Oliver Pinter Date: Tue, 10 Apr 2018 01:29:19 +0200 Message-ID: Subject: Re: svn commit: r331880 - stable/11/etc To: Warner Losh Cc: Kyle Evans , src-committers , "svn-src-stable@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-stable-11@freebsd.org" , "Rodney W. Grimes" , Niclas Zeising Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 23:29:21 -0000 On Monday, April 9, 2018, Warner Losh wrote: > On Mon, Apr 9, 2018 at 10:09 AM, Kyle Evans wrote: > > > Right- so, back out this MFC (and the subsequent FreeBSD_version bump) > > and fix the ports to do the right thing for 12.x while that's still > > not a technically supported branch? > > > Don't back out the version bump. Other things may be riding along on it > 'for free'. Better to bump it again when you unMFC (if it's been more than > a few days since we've had one), and then yet-again when a fixed MFC > happens. Unless there's something you can ride along on for free :) > > Otherwise, that's a great plan. What's about "direction Z"? Like moving find to /bin and do a compatibility symlink for them from /usr/bin? > > Warner > _______________________________________________ > svn-src-stable-11@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-stable-11 > To unsubscribe, send any mail to " > svn-src-stable-11-unsubscribe@freebsd.org" > From owner-svn-src-stable@freebsd.org Tue Apr 10 02:28:25 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C799AF9465E; Tue, 10 Apr 2018 02:28:24 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (unknown [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 72A3373B0A; Tue, 10 Apr 2018 02:28:24 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf0-f53.google.com (mail-lf0-f53.google.com [209.85.215.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 1EFB8CDC5; Tue, 10 Apr 2018 02:28:24 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf0-f53.google.com with SMTP id x70-v6so9389808lfa.0; Mon, 09 Apr 2018 19:28:24 -0700 (PDT) X-Gm-Message-State: ALQs6tA36P8k/Vw7v8wivFxe0owhYN1to/P67lDtX2Z4/It0QCIHcGHw qTbFK7o+BHOjHljnpDoyHVnYURB68V8yLZEUPUY= X-Google-Smtp-Source: AIpwx48gFoO7n1Xrrt1uQ0pQ5oaFFU9+SqtBJsn3cO9gdkCmhAhEoKL6TEzkS1tGvUO7JtT/6wXOOIHpWBQH6q2p/rI= X-Received: by 10.46.29.1 with SMTP id d1mr23874733ljd.22.1523327302552; Mon, 09 Apr 2018 19:28:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.129.90 with HTTP; Mon, 9 Apr 2018 19:28:01 -0700 (PDT) In-Reply-To: References: <201804091552.w39Fqv2S019416@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Mon, 9 Apr 2018 21:28:01 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r331880 - stable/11/etc To: Warner Losh Cc: "Rodney W. Grimes" , Niclas Zeising , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 02:28:25 -0000 On Mon, Apr 9, 2018 at 11:59 AM, Warner Losh wrote: > > > On Mon, Apr 9, 2018 at 10:09 AM, Kyle Evans wrote: >> >> Right- so, back out this MFC (and the subsequent FreeBSD_version bump) >> and fix the ports to do the right thing for 12.x while that's still >> not a technically supported branch? > > > Don't back out the version bump. Other things may be riding along on it 'for > free'. Better to bump it again when you unMFC (if it's been more than a few > days since we've had one), and then yet-again when a fixed MFC happens. > Unless there's something you can ride along on for free :) > > Otherwise, that's a great plan. Ok, I think the result of this thread and discussion with 0mp is the following set of actions: 1.) One (1) commit to stable/11 to revert the MFC and bump FreeBSD_Version again for the removal 2.) One (1) commit to doc to document the new FreeBSD_Version 3.) Fixing ports to use the "new" behavior on 12, both the yet-to-be-patched ports and the ports that had already been patched under the assumption that it would still land first in 11.1-stable 4.) Documenting the original commit? The hard part of point #3 has already been done by 0mp, who has submitted patches for all of the ports using this behavior. His patches will just need a bump of the version they're testing to the 12.x FreeBSD_Version and a fix-up on the patches that already landed. For point #4, this seems like the type of breakage we should be documenting in release notes or something for the eventual upgrading of systems to 12.0. All usage of _limits stuff in custom rc scripts need to be audited, and all rc.conf(5)'s need to be scrubbed for ${name}_limits usage that doesn't make sense with the new context. I'm not sure what the most appropriate action here is, or what we should do this far ahead of time for such a thing. If this sounds like a good path forward, I'll execute #1 and #2 in the morning (CST, so ~11 hours from this e-mail being sent). From owner-svn-src-stable@freebsd.org Tue Apr 10 03:12:23 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 144D7F97CA3; Tue, 10 Apr 2018 03:12:23 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B870C7F00C; Tue, 10 Apr 2018 03:12:22 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF51727C1A; Tue, 10 Apr 2018 03:12:22 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3A3CMqj054649; Tue, 10 Apr 2018 03:12:22 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3A3CMVj054648; Tue, 10 Apr 2018 03:12:22 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201804100312.w3A3CMVj054648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 10 Apr 2018 03:12:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332347 - stable/11/usr.sbin/rpcbind X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/11/usr.sbin/rpcbind X-SVN-Commit-Revision: 332347 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 03:12:23 -0000 Author: delphij Date: Tue Apr 10 03:12:22 2018 New Revision: 332347 URL: https://svnweb.freebsd.org/changeset/base/332347 Log: MFC r331180: Plug a possible memory leak. Modified: stable/11/usr.sbin/rpcbind/rpcbind.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/rpcbind/rpcbind.c ============================================================================== --- stable/11/usr.sbin/rpcbind/rpcbind.c Tue Apr 10 02:49:53 2018 (r332346) +++ stable/11/usr.sbin/rpcbind/rpcbind.c Tue Apr 10 03:12:22 2018 (r332347) @@ -550,6 +550,8 @@ init_transport(struct netconfig *nconf) pml->pml_map.pm_port = PMAPPORT; if (strcmp(nconf->nc_proto, NC_TCP) == 0) { if (tcptrans[0]) { + free(pml); + pml = NULL; syslog(LOG_ERR, "cannot have more than one TCP transport"); goto error; From owner-svn-src-stable@freebsd.org Tue Apr 10 03:15:08 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEC43F97FBD; Tue, 10 Apr 2018 03:15:07 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A524880736; Tue, 10 Apr 2018 03:15:07 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9FD2727C2D; Tue, 10 Apr 2018 03:15:07 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3A3F7wN054791; Tue, 10 Apr 2018 03:15:07 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3A3F7Tk054790; Tue, 10 Apr 2018 03:15:07 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201804100315.w3A3F7Tk054790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 10 Apr 2018 03:15:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332348 - stable/10/usr.sbin/rpcbind X-SVN-Group: stable-10 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/10/usr.sbin/rpcbind X-SVN-Commit-Revision: 332348 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 03:15:08 -0000 Author: delphij Date: Tue Apr 10 03:15:07 2018 New Revision: 332348 URL: https://svnweb.freebsd.org/changeset/base/332348 Log: MFC r331180: Plug a possible memory leak. Modified: stable/10/usr.sbin/rpcbind/rpcbind.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/rpcbind/rpcbind.c ============================================================================== --- stable/10/usr.sbin/rpcbind/rpcbind.c Tue Apr 10 03:12:22 2018 (r332347) +++ stable/10/usr.sbin/rpcbind/rpcbind.c Tue Apr 10 03:15:07 2018 (r332348) @@ -548,6 +548,8 @@ init_transport(struct netconfig *nconf) pml->pml_map.pm_port = PMAPPORT; if (strcmp(nconf->nc_proto, NC_TCP) == 0) { if (tcptrans[0]) { + free(pml); + pml = NULL; syslog(LOG_ERR, "cannot have more than one TCP transport"); goto error; From owner-svn-src-stable@freebsd.org Tue Apr 10 04:22:24 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56E63F9D52A; Tue, 10 Apr 2018 04:22:24 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB6DD6F606; Tue, 10 Apr 2018 04:22:23 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w3A4M8Rp021575; Mon, 9 Apr 2018 21:22:08 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w3A4M7VO021574; Mon, 9 Apr 2018 21:22:07 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804100422.w3A4M7VO021574@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r331880 - stable/11/etc In-Reply-To: To: Kyle Evans Date: Mon, 9 Apr 2018 21:22:07 -0700 (PDT) CC: Warner Losh , "Rodney W. Grimes" , Niclas Zeising , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , svn-src-stable-11@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 04:22:24 -0000 [ Charset UTF-8 unsupported, converting... ] > On Mon, Apr 9, 2018 at 11:59 AM, Warner Losh wrote: > > > > > > On Mon, Apr 9, 2018 at 10:09 AM, Kyle Evans wrote: > >> > >> Right- so, back out this MFC (and the subsequent FreeBSD_version bump) > >> and fix the ports to do the right thing for 12.x while that's still > >> not a technically supported branch? > > > > > > Don't back out the version bump. Other things may be riding along on it 'for > > free'. Better to bump it again when you unMFC (if it's been more than a few > > days since we've had one), and then yet-again when a fixed MFC happens. > > Unless there's something you can ride along on for free :) > > > > Otherwise, that's a great plan. > > Ok, I think the result of this thread and discussion with 0mp is the > following set of actions: > > 1.) One (1) commit to stable/11 to revert the MFC and bump > FreeBSD_Version again for the removal > 2.) One (1) commit to doc to document the new FreeBSD_Version > 3.) Fixing ports to use the "new" behavior on 12, both the > yet-to-be-patched ports and the ports that had already been patched > under the assumption that it would still land first in 11.1-stable > 4.) Documenting the original commit? > > The hard part of point #3 has already been done by 0mp, who has > submitted patches for all of the ports using this behavior. His > patches will just need a bump of the version they're testing to the > 12.x FreeBSD_Version and a fix-up on the patches that already landed. > > For point #4, this seems like the type of breakage we should be > documenting in release notes or something for the eventual upgrading > of systems to 12.0. All usage of _limits stuff in custom rc scripts > need to be audited, and all rc.conf(5)'s need to be scrubbed for > ${name}_limits usage that doesn't make sense with the new context. I'm > not sure what the most appropriate action here is, or what we should > do this far ahead of time for such a thing. We do need a way to stack little notes that need to make it into the release notes, even if there is no single commit they are related to, or in this case we find out later that a change had wider impacts and needs to have a note added. Maybe gjb@ has a place we can just commit to that gets collected for the release? > If this sounds like a good path forward, I'll execute #1 and #2 in the > morning (CST, so ~11 hours from this e-mail being sent). I am on board with this much of this plan. What about cy@ changes to the ddb and other startup scripts? -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-stable@freebsd.org Tue Apr 10 06:57:07 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 552DCF821BA; Tue, 10 Apr 2018 06:57:07 +0000 (UTC) (envelope-from zeising+freebsd@daemonic.se) Received: from mail.daemonic.se (mail.daemonic.se [176.58.89.161]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB4FE71855; Tue, 10 Apr 2018 06:57:06 +0000 (UTC) (envelope-from zeising+freebsd@daemonic.se) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 40Kydr2lynzDhHq; Tue, 10 Apr 2018 06:57:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=daemonic.se; h= content-transfer-encoding:content-language:content-type :content-type:in-reply-to:mime-version:user-agent:date:date :message-id:from:from:references:subject:subject:received :received; s=20151023; t=1523343423; bh=iNrI/OSAJSpIEv3gK06oGAq0 nfftQzeNb9W5ui1JO50=; b=ObxJlAbBB0z5BZF0MClLYI+iRRe/9X3bDRR3vaHN au3CQO7AaHVgT4EoKXCVWKWU4i7/HUCkbTpXGuOZKyxBXScqnkx1KOSqgZyiyFki PLB4ZyvNXEmrztJscNRF7gcc7RJyZrbqEIpbMCQZbfDHKi+LaWX6vKaOMuBYBU5g mlk= X-Virus-Scanned: amavisd-new at daemonic.se Received: from mail.daemonic.se ([IPv6:::1]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256) by cid.daemonic.se (mailscanner.daemonic.se [IPv6:::1]) (amavisd-new, port 10587) with ESMTPS id p-FRygrG-u5T; Tue, 10 Apr 2018 06:57:03 +0000 (UTC) Received: from garnet.daemonic.se (host-90-232-228-250.mobileonline.telia.com [90.232.228.250]) by mail.daemonic.se (Postfix) with ESMTPSA id 40Kydq0gdxzDh2K; Tue, 10 Apr 2018 06:57:03 +0000 (UTC) Subject: Re: svn commit: r331880 - stable/11/etc To: Kyle Evans , Warner Losh Cc: "Rodney W. Grimes" , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , svn-src-stable-11@freebsd.org References: <201804091552.w39Fqv2S019416@pdx.rh.CN85.dnsmgr.net> From: Niclas Zeising Message-ID: <6928b703-536e-b1a7-2a80-6796db15affc@daemonic.se> Date: Tue, 10 Apr 2018 08:56:44 +0200 User-Agent: Mutt/1.5.21 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 06:57:07 -0000 On 04/10/18 04:28, Kyle Evans wrote: > On Mon, Apr 9, 2018 at 11:59 AM, Warner Losh wrote: >> >> >> On Mon, Apr 9, 2018 at 10:09 AM, Kyle Evans wrote: >>> >>> Right- so, back out this MFC (and the subsequent FreeBSD_version bump) >>> and fix the ports to do the right thing for 12.x while that's still >>> not a technically supported branch? >> >> >> Don't back out the version bump. Other things may be riding along on it 'for >> free'. Better to bump it again when you unMFC (if it's been more than a few >> days since we've had one), and then yet-again when a fixed MFC happens. >> Unless there's something you can ride along on for free :) >> >> Otherwise, that's a great plan. > > Ok, I think the result of this thread and discussion with 0mp is the > following set of actions: > > 1.) One (1) commit to stable/11 to revert the MFC and bump > FreeBSD_Version again for the removal > 2.) One (1) commit to doc to document the new FreeBSD_Version > 3.) Fixing ports to use the "new" behavior on 12, both the > yet-to-be-patched ports and the ports that had already been patched > under the assumption that it would still land first in 11.1-stable > 4.) Documenting the original commit? > > The hard part of point #3 has already been done by 0mp, who has > submitted patches for all of the ports using this behavior. His > patches will just need a bump of the version they're testing to the > 12.x FreeBSD_Version and a fix-up on the patches that already landed. > > For point #4, this seems like the type of breakage we should be > documenting in release notes or something for the eventual upgrading > of systems to 12.0. All usage of _limits stuff in custom rc scripts > need to be audited, and all rc.conf(5)'s need to be scrubbed for > ${name}_limits usage that doesn't make sense with the new context. I'm > not sure what the most appropriate action here is, or what we should > do this far ahead of time for such a thing. > > If this sounds like a good path forward, I'll execute #1 and #2 in the > morning (CST, so ~11 hours from this e-mail being sent). > This still doesn't fix the issue of some early start up scripts depending on stuff that's not available yet, when for instance /usr is on a separate FS (which was the normal way to set up a system way back when). This issue was first noticed more than 2 years ago, so someone did notice the breakage. It just hasn't been fixed for an entire release cycle. Regards -- Niclas From owner-svn-src-stable@freebsd.org Tue Apr 10 08:07:56 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE783F870FF; Tue, 10 Apr 2018 08:07:56 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5631780E5E; Tue, 10 Apr 2018 08:07:56 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 4C67E12E64; Tue, 10 Apr 2018 08:07:56 +0000 (UTC) Date: Tue, 10 Apr 2018 08:07:56 +0000 From: Alexey Dokuchaev To: Oliver Pinter Cc: Warner Losh , src-committers , Kyle Evans , "svn-src-all@freebsd.org" , "svn-src-stable-11@freebsd.org" , "Rodney W. Grimes" , "svn-src-stable@freebsd.org" , Niclas Zeising Subject: Re: svn commit: r331880 - stable/11/etc Message-ID: <20180410080756.GA1703@FreeBSD.org> References: <201804091552.w39Fqv2S019416@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 08:07:56 -0000 On Tue, Apr 10, 2018 at 01:29:19AM +0200, Oliver Pinter wrote: > On Monday, April 9, 2018, Warner Losh wrote: > > On Mon, Apr 9, 2018 at 10:09 AM, Kyle Evans wrote: > > > Right- so, back out this MFC (and the subsequent FreeBSD_version bump) > > > and fix the ports to do the right thing for 12.x while that's still > > > not a technically supported branch? > > > > Don't back out the version bump. Other things may be riding along on it > > 'for free'. Better to bump it again when you unMFC (if it's been more than > > a few days since we've had one), and then yet-again when a fixed MFC > > happens. Unless there's something you can ride along on for free :) > > > > Otherwise, that's a great plan. > > What's about "direction Z"? Like moving find to /bin and do a compatibility > symlink for them from /usr/bin? That smells fishy. Reminds me of GNU/Linux where I typically have to parse through gazillion of compatibility symlinks before stumbling upon 30-byte shim saying "implemented in systemd now". :-( ./danfe From owner-svn-src-stable@freebsd.org Tue Apr 10 13:16:01 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 619CBF9C066; Tue, 10 Apr 2018 13:16:01 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 07D99692D8; Tue, 10 Apr 2018 13:16:01 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf0-f44.google.com (mail-lf0-f44.google.com [209.85.215.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id B25CA10D4A; Tue, 10 Apr 2018 13:16:00 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf0-f44.google.com with SMTP id q9-v6so11608092lfk.9; Tue, 10 Apr 2018 06:16:00 -0700 (PDT) X-Gm-Message-State: ALQs6tDI14rFqQ+j90mGb/az+p/q1Ps7KAgOYRpYrg3AZGlNZ438OCks VGIsqEIYoBQ/8FC/jtky4GGECU5aGXPAV3HIqNE= X-Google-Smtp-Source: AIpwx4+GnyrOvqJoMF866D+SCGoD2fdS85Jc04L9qYQ3Tir9ITaUdZG53zg45lSWvGiaEjS3AcHIVJUOvZXeA42xne8= X-Received: by 2002:a19:d911:: with SMTP id q17-v6mr194455lfg.99.1523366159330; Tue, 10 Apr 2018 06:15:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.129.90 with HTTP; Tue, 10 Apr 2018 06:15:38 -0700 (PDT) In-Reply-To: <201804100422.w3A4M7VO021574@pdx.rh.CN85.dnsmgr.net> References: <201804100422.w3A4M7VO021574@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Tue, 10 Apr 2018 08:15:38 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r331880 - stable/11/etc To: "Rodney W. Grimes" Cc: Niclas Zeising , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 13:16:01 -0000 On Mon, Apr 9, 2018 at 11:22 PM, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] >> On Mon, Apr 9, 2018 at 11:59 AM, Warner Losh wrote: >> > >> > >> > On Mon, Apr 9, 2018 at 10:09 AM, Kyle Evans wrote: >> >> >> >> Right- so, back out this MFC (and the subsequent FreeBSD_version bump) >> >> and fix the ports to do the right thing for 12.x while that's still >> >> not a technically supported branch? >> > >> > >> > Don't back out the version bump. Other things may be riding along on it 'for >> > free'. Better to bump it again when you unMFC (if it's been more than a few >> > days since we've had one), and then yet-again when a fixed MFC happens. >> > Unless there's something you can ride along on for free :) >> > >> > Otherwise, that's a great plan. >> >> Ok, I think the result of this thread and discussion with 0mp is the >> following set of actions: >> >> 1.) One (1) commit to stable/11 to revert the MFC and bump >> FreeBSD_Version again for the removal >> 2.) One (1) commit to doc to document the new FreeBSD_Version >> 3.) Fixing ports to use the "new" behavior on 12, both the >> yet-to-be-patched ports and the ports that had already been patched >> under the assumption that it would still land first in 11.1-stable >> 4.) Documenting the original commit? >> >> The hard part of point #3 has already been done by 0mp, who has >> submitted patches for all of the ports using this behavior. His >> patches will just need a bump of the version they're testing to the >> 12.x FreeBSD_Version and a fix-up on the patches that already landed. >> >> For point #4, this seems like the type of breakage we should be >> documenting in release notes or something for the eventual upgrading >> of systems to 12.0. All usage of _limits stuff in custom rc scripts >> need to be audited, and all rc.conf(5)'s need to be scrubbed for >> ${name}_limits usage that doesn't make sense with the new context. I'm >> not sure what the most appropriate action here is, or what we should >> do this far ahead of time for such a thing. > > We do need a way to stack little notes that need to make it into > the release notes, even if there is no single commit they are related > to, or in this case we find out later that a change had wider > impacts and needs to have a note added. Maybe gjb@ has a place we > can just commit to that gets collected for the release? > >> If this sounds like a good path forward, I'll execute #1 and #2 in the >> morning (CST, so ~11 hours from this e-mail being sent). > > I am on board with this much of this plan. > > > What about cy@ changes to the ddb and other startup scripts? > Right- I was mostly concerned with fixing the fallout from this particular commit. I think that merits its own discussion in a separate thread or in the early referenced PR, but I'm tempted to go ahead and commit Cy's ddb patch to start while we assess the other damage. From owner-svn-src-stable@freebsd.org Tue Apr 10 13:35:08 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 504E2F9D5A2; Tue, 10 Apr 2018 13:35:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ED3E96F0B1; Tue, 10 Apr 2018 13:35:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E42CD6420; Tue, 10 Apr 2018 13:35:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3ADZ7e3062807; Tue, 10 Apr 2018 13:35:07 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3ADZ75V062805; Tue, 10 Apr 2018 13:35:07 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804101335.w3ADZ75V062805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 10 Apr 2018 13:35:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332363 - in stable/11: etc sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11: etc sys/sys X-SVN-Commit-Revision: 332363 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 13:35:08 -0000 Author: kevans Date: Tue Apr 10 13:35:07 2018 New Revision: 332363 URL: https://svnweb.freebsd.org/changeset/base/332363 Log: Revert r331880, MFC of r328331 and bump FreeBSD_version There are logistics issues that weren't considered when this was originally MFC'd. All rc scripts in ports need audited (this is in progress) for usage of ${name}_limits that doesn't line up with the new interpretation, and individual rc.conf(5)'s need to be scrubbed of usage that doesn't line up. It's since been decided that it should be left for a feature in 12. 1101514 introduced interpretation of ${name}_limits for rc scripts; this feature no longer exists as of 1101515. Modified: stable/11/etc/rc.subr stable/11/sys/sys/param.h Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/rc.subr ============================================================================== --- stable/11/etc/rc.subr Tue Apr 10 13:25:42 2018 (r332362) +++ stable/11/etc/rc.subr Tue Apr 10 13:35:07 2018 (r332363) @@ -773,8 +773,6 @@ check_startmsgs() # # ${name}_login_class n Login class to use, else "daemon". # -# ${name}_limits n limits(1) to apply to ${command}. -# # ${rc_arg}_cmd n If set, use this as the method when invoked; # Otherwise, use default command (see below) # @@ -954,7 +952,7 @@ run_rc_command() _group=\$${name}_group _groups=\$${name}_groups \ _fib=\$${name}_fib _env=\$${name}_env \ _prepend=\$${name}_prepend _login_class=\${${name}_login_class:-daemon} \ - _limits=\$${name}_limits _oomprotect=\$${name}_oomprotect + _oomprotect=\$${name}_oomprotect if [ -n "$_user" ]; then # unset $_user if running as that user if [ "$_user" = "$(eval $IDCMD)" ]; then @@ -1075,7 +1073,7 @@ $command $rc_flags $command_args" fi # Prepend default limits - _doit="$_cd limits -C $_login_class $_limits $_doit" + _doit="$_cd limits -C $_login_class $_doit" # run the full command # Modified: stable/11/sys/sys/param.h ============================================================================== --- stable/11/sys/sys/param.h Tue Apr 10 13:25:42 2018 (r332362) +++ stable/11/sys/sys/param.h Tue Apr 10 13:35:07 2018 (r332363) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1101514 /* Master, propagated to newvers */ +#define __FreeBSD_version 1101515 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-stable@freebsd.org Tue Apr 10 13:56:31 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 061AAF9EC15; Tue, 10 Apr 2018 13:56:31 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AD22A7281B; Tue, 10 Apr 2018 13:56:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A81846757; Tue, 10 Apr 2018 13:56:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3ADuUDw072833; Tue, 10 Apr 2018 13:56:30 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3ADuU98072832; Tue, 10 Apr 2018 13:56:30 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804101356.w3ADuU98072832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 10 Apr 2018 13:56:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332366 - stable/11 X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11 X-SVN-Commit-Revision: 332366 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 13:56:31 -0000 Author: kevans Date: Tue Apr 10 13:56:30 2018 New Revision: 332366 URL: https://svnweb.freebsd.org/changeset/base/332366 Log: MFC r316487, r316516, r316546, r316567: One big nop r316487: Allow command modifiers (fast, quiet etc.) to be stacked in any order. Add a "debug" modifier that sets rc_debug. r316516: r316487 altered the defined values of rc_force from "yes" (for yes) and NULL (for no) to "no" (for no) and no change to the definition of yes. Two rc.d scripts, dhclient and bgfsck check rc_force for yesi, using test -n, and no, using test -z. The redefinition of yes and no by r316487 caused rc.d/dhclient, when invoked by devd using a devd.conf rule, to assign DHCP assigned IP addresses for interfaces with statically assigned interfaces, breaking boot. Point of breakage was at line 25 of etc/rc.d/dhclient (r301068) where $rc_force needs to be NULL. X-MFC with: r316487 r316546: Revert r316516. des@ asked that r316516 be reverted so that he can spend a little more time getting r316487 right. Requested by: des@ r316567: Revert r316487. It is broken, causing boot to fail due to line 25 in etc/rc.d/dhclient unconditionally testing true when called by a devd rule during boot, ignoring statically assigned IP addresses in rc.conf. Requested by: des@ Modified: Directory Properties: stable/11/ (props changed) From owner-svn-src-stable@freebsd.org Tue Apr 10 14:00:46 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A557F9F135; Tue, 10 Apr 2018 14:00:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B410372C44; Tue, 10 Apr 2018 14:00:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF0CC676B; Tue, 10 Apr 2018 14:00:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3AE0js3073299; Tue, 10 Apr 2018 14:00:45 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3AE0jKe073298; Tue, 10 Apr 2018 14:00:45 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804101400.w3AE0jKe073298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 10 Apr 2018 14:00:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332367 - stable/11/etc X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/etc X-SVN-Commit-Revision: 332367 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 14:00:46 -0000 Author: kevans Date: Tue Apr 10 14:00:45 2018 New Revision: 332367 URL: https://svnweb.freebsd.org/changeset/base/332367 Log: MFC r308896 r308896: rc.subr: $(ps -p $$ -o jid=) is always 0, so do not fork ps for it. The JID keyword writes 0 for a process also in the host system or in the same jail. Modified: stable/11/etc/rc.subr Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/rc.subr ============================================================================== --- stable/11/etc/rc.subr Tue Apr 10 13:56:30 2018 (r332366) +++ stable/11/etc/rc.subr Tue Apr 10 14:00:45 2018 (r332367) @@ -49,7 +49,7 @@ PROTECT="/usr/bin/protect" ID="/usr/bin/id" IDCMD="if [ -x $ID ]; then $ID -un; fi" PS="/bin/ps -ww" -JID=`$PS -p $$ -o jid=` +JID=0 # # functions From owner-svn-src-stable@freebsd.org Tue Apr 10 14:04:11 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C50F1F9F6DD; Tue, 10 Apr 2018 14:04:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 72E9073234; Tue, 10 Apr 2018 14:04:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6DD2D68F4; Tue, 10 Apr 2018 14:04:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3AE4B04078212; Tue, 10 Apr 2018 14:04:11 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3AE4BVw078210; Tue, 10 Apr 2018 14:04:11 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804101404.w3AE4BVw078210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 10 Apr 2018 14:04:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332368 - in stable/11/etc: . defaults X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/etc: . defaults X-SVN-Commit-Revision: 332368 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 14:04:12 -0000 Author: kevans Date: Tue Apr 10 14:04:11 2018 New Revision: 332368 URL: https://svnweb.freebsd.org/changeset/base/332368 Log: MFC r309350, r309352 r309350: If the kenv variable rc_debug is set, turn on rc_debug. r309352: Finish incomplete comments in prior revision. I was going to fix this after I tested it, but didn't. Modified: stable/11/etc/defaults/rc.conf stable/11/etc/rc.subr Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/defaults/rc.conf ============================================================================== --- stable/11/etc/defaults/rc.conf Tue Apr 10 14:00:45 2018 (r332367) +++ stable/11/etc/defaults/rc.conf Tue Apr 10 14:04:11 2018 (r332368) @@ -21,6 +21,8 @@ ### Important initial Boot-time options #################### ############################################################## +# rc_debug can't be set here without interferring with rc.subr's setting it +# when the kenv variable rc.debug is set. #rc_debug="NO" # Set to YES to enable debugging output from rc.d rc_info="NO" # Enables display of informational messages at boot. rc_startmsgs="YES" # Show "Starting foo:" messages at boot Modified: stable/11/etc/rc.subr ============================================================================== --- stable/11/etc/rc.subr Tue Apr 10 14:00:45 2018 (r332367) +++ stable/11/etc/rc.subr Tue Apr 10 14:04:11 2018 (r332368) @@ -2166,6 +2166,13 @@ _echoonce() esac } +# If the loader env variable rc.debug is set, turn on debugging. rc.conf will +# still override this, but /etc/defaults/rc.conf can't unconditionally set this +# since it would undo what we've done here. +if kenv -q rc.debug > /dev/null ; then + rc_debug=YES +fi + fi # [ -z "${_rc_subr_loaded}" ] _rc_subr_loaded=: From owner-svn-src-stable@freebsd.org Tue Apr 10 14:07:30 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1606F9FA94; Tue, 10 Apr 2018 14:07:30 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 536C6747B8; Tue, 10 Apr 2018 14:07:30 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B5D068F8; Tue, 10 Apr 2018 14:07:30 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3AE7UYD078419; Tue, 10 Apr 2018 14:07:30 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3AE7Twe078417; Tue, 10 Apr 2018 14:07:29 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201804101407.w3AE7Twe078417@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 10 Apr 2018 14:07:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332370 - in stable: 10/release/doc/share/xml 11/release/doc/share/xml X-SVN-Group: stable-10 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 10/release/doc/share/xml 11/release/doc/share/xml X-SVN-Commit-Revision: 332370 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 14:07:31 -0000 Author: gjb Date: Tue Apr 10 14:07:29 2018 New Revision: 332370 URL: https://svnweb.freebsd.org/changeset/base/332370 Log: Document EN-18:03, EN-18:04, SA-18:04, SA-18:05. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/share/xml/errata.xml stable/10/release/doc/share/xml/security.xml Changes in other areas also in this revision: Modified: stable/11/release/doc/share/xml/errata.xml stable/11/release/doc/share/xml/security.xml Modified: stable/10/release/doc/share/xml/errata.xml ============================================================================== --- stable/10/release/doc/share/xml/errata.xml Tue Apr 10 14:07:02 2018 (r332369) +++ stable/10/release/doc/share/xml/errata.xml Tue Apr 10 14:07:29 2018 (r332370) @@ -40,6 +40,22 @@ 07 March 2018 Stack-based buffer overflow + + + FreeBSD-EN-18:03.tzdata + 04 April 2018 + Update timezone database + information + + + + FreeBSD-EN-18:04.mem + 04 April 2018 + Multiple small kernel memory + disclosures + Modified: stable/10/release/doc/share/xml/security.xml ============================================================================== --- stable/10/release/doc/share/xml/security.xml Tue Apr 10 14:07:02 2018 (r332369) +++ stable/10/release/doc/share/xml/security.xml Tue Apr 10 14:07:29 2018 (r332370) @@ -83,6 +83,21 @@ 07 March 2018 Multiple vulnerabilities + + + FreeBSD-SA-18:04.vt + 04 April 2018 + Fix &man.vt.4; console memory + disclosure + + + + FreeBSD-SA-18:05.ipsec + 04 April 2018 + Fix denial of service + From owner-svn-src-stable@freebsd.org Tue Apr 10 14:07:31 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7421F9FA95; Tue, 10 Apr 2018 14:07:30 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 866AE747BC; Tue, 10 Apr 2018 14:07:30 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8167868F9; Tue, 10 Apr 2018 14:07:30 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3AE7ULo078426; Tue, 10 Apr 2018 14:07:30 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3AE7UU3078424; Tue, 10 Apr 2018 14:07:30 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201804101407.w3AE7UU3078424@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 10 Apr 2018 14:07:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332370 - in stable: 10/release/doc/share/xml 11/release/doc/share/xml X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 10/release/doc/share/xml 11/release/doc/share/xml X-SVN-Commit-Revision: 332370 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 14:07:31 -0000 Author: gjb Date: Tue Apr 10 14:07:29 2018 New Revision: 332370 URL: https://svnweb.freebsd.org/changeset/base/332370 Log: Document EN-18:03, EN-18:04, SA-18:04, SA-18:05. Sponsored by: The FreeBSD Foundation Modified: stable/11/release/doc/share/xml/errata.xml stable/11/release/doc/share/xml/security.xml Changes in other areas also in this revision: Modified: stable/10/release/doc/share/xml/errata.xml stable/10/release/doc/share/xml/security.xml Modified: stable/11/release/doc/share/xml/errata.xml ============================================================================== --- stable/11/release/doc/share/xml/errata.xml Tue Apr 10 14:07:02 2018 (r332369) +++ stable/11/release/doc/share/xml/errata.xml Tue Apr 10 14:07:29 2018 (r332370) @@ -56,6 +56,22 @@ 07 March 2018 Stack-based buffer overflow + + + FreeBSD-EN-18:03.tzdata + 04 April 2018 + Update timezone database + information + + + + FreeBSD-EN-18:04.mem + 04 April 2018 + Multiple small kernel memory + disclosures + Modified: stable/11/release/doc/share/xml/security.xml ============================================================================== --- stable/11/release/doc/share/xml/security.xml Tue Apr 10 14:07:02 2018 (r332369) +++ stable/11/release/doc/share/xml/security.xml Tue Apr 10 14:07:29 2018 (r332370) @@ -91,6 +91,21 @@ + + + FreeBSD-SA-18:04.vt + 04 April 2018 + Fix &man.vt.4; console memory + disclosure + + + + FreeBSD-SA-18:05.ipsec + 04 April 2018 + Fix denial of service + From owner-svn-src-stable@freebsd.org Tue Apr 10 14:13:36 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6687FA03D1; Tue, 10 Apr 2018 14:13:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 62A6C766C2; Tue, 10 Apr 2018 14:13:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 448516A99; Tue, 10 Apr 2018 14:13:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3AEDamm083246; Tue, 10 Apr 2018 14:13:36 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3AEDar4083245; Tue, 10 Apr 2018 14:13:36 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804101413.w3AEDar4083245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 10 Apr 2018 14:13:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332371 - stable/11/etc X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/etc X-SVN-Commit-Revision: 332371 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 14:13:37 -0000 Author: kevans Date: Tue Apr 10 14:13:35 2018 New Revision: 332371 URL: https://svnweb.freebsd.org/changeset/base/332371 Log: MFC r319828, r324625 r319828: rc.subr: Optimize repeated sourcing. When /etc/rc runs all /etc/rc.d scripts, it has already loaded /etc/rc.subr but each /etc/rc.d script sources it again (since /etc/rc.d scripts must also work when started stand-alone). Therefore, if rc.subr is already loaded, return so sh need not parse the rest of the file. A second effect is that there is no longer a compound command around most of rc.subr. This reduces memory usage while sh is loading rc.subr for the first time (but this memory is free()d once rc.subr is loaded). For purposes of porting this to other systems, I do not recommend porting this to systems with shells that do not have the change to the return special builtin like in r255215 (before FreeBSD 10.0-RELEASE). This change ensures that return in the top level of a dot script returns from the dot script, even if the dot script was sourced from a function. A comparison of CPU time on an amd64 bhyve virtual machine from a times command added near the end of /etc/rc, all four values summed: x orig1 + quickreturn +--------------------------------------------------------------------------+ | + + + x x x| ||______M__A_________| |______M___A__________| | +--------------------------------------------------------------------------+ N Min Max Median Avg Stddev x 3 1.704 1.802 1.726 1.744 0.051419841 + 3 1.467 1.559 1.487 1.5043333 0.048387326 Difference at 95.0% confidence -0.239667 +/- 0.113163 -13.7424% +/- 6.48873% (Student's t, pooled s = 0.0499266) r324625: rc.subr: Remove test that is always true. The code above always sets _pidcmd to a non-empty value. Modified: stable/11/etc/rc.subr Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/rc.subr ============================================================================== --- stable/11/etc/rc.subr Tue Apr 10 14:07:29 2018 (r332370) +++ stable/11/etc/rc.subr Tue Apr 10 14:13:35 2018 (r332371) @@ -38,7 +38,9 @@ # Operating System dependent/independent variables # -if [ -z "${_rc_subr_loaded}" ]; then +if [ -n "${_rc_subr_loaded}" ]; then + return +fi _rc_subr_loaded="YES" @@ -928,9 +930,7 @@ run_rc_command() else _pidcmd='rc_pid=$(check_process '"$_procname $command_interpreter"')' fi - if [ -n "$_pidcmd" ]; then - _keywords="${_keywords} status poll" - fi + _keywords="${_keywords} status poll" fi if [ -z "$rc_arg" ]; then @@ -2172,7 +2172,3 @@ _echoonce() if kenv -q rc.debug > /dev/null ; then rc_debug=YES fi - -fi # [ -z "${_rc_subr_loaded}" ] - -_rc_subr_loaded=: From owner-svn-src-stable@freebsd.org Tue Apr 10 15:01:07 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89B63FA30C5; Tue, 10 Apr 2018 15:01:07 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0819E811F2; Tue, 10 Apr 2018 15:01:06 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w3AF0ro9023724; Tue, 10 Apr 2018 08:00:53 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w3AF0r8o023723; Tue, 10 Apr 2018 08:00:53 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804101500.w3AF0r8o023723@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r331880 - stable/11/etc In-Reply-To: <6928b703-536e-b1a7-2a80-6796db15affc@daemonic.se> To: Niclas Zeising Date: Tue, 10 Apr 2018 08:00:53 -0700 (PDT) CC: Kyle Evans , Warner Losh , "Rodney W. Grimes" , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , svn-src-stable-11@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 15:01:07 -0000 > On 04/10/18 04:28, Kyle Evans wrote: > > On Mon, Apr 9, 2018 at 11:59 AM, Warner Losh wrote: > >> > >> > >> On Mon, Apr 9, 2018 at 10:09 AM, Kyle Evans wrote: > >>> > >>> Right- so, back out this MFC (and the subsequent FreeBSD_version bump) > >>> and fix the ports to do the right thing for 12.x while that's still > >>> not a technically supported branch? > >> > >> > >> Don't back out the version bump. Other things may be riding along on it 'for > >> free'. Better to bump it again when you unMFC (if it's been more than a few > >> days since we've had one), and then yet-again when a fixed MFC happens. > >> Unless there's something you can ride along on for free :) > >> > >> Otherwise, that's a great plan. > > > > Ok, I think the result of this thread and discussion with 0mp is the > > following set of actions: > > > > 1.) One (1) commit to stable/11 to revert the MFC and bump > > FreeBSD_Version again for the removal > > 2.) One (1) commit to doc to document the new FreeBSD_Version > > 3.) Fixing ports to use the "new" behavior on 12, both the > > yet-to-be-patched ports and the ports that had already been patched > > under the assumption that it would still land first in 11.1-stable > > 4.) Documenting the original commit? > > > > The hard part of point #3 has already been done by 0mp, who has > > submitted patches for all of the ports using this behavior. His > > patches will just need a bump of the version they're testing to the > > 12.x FreeBSD_Version and a fix-up on the patches that already landed. > > > > For point #4, this seems like the type of breakage we should be > > documenting in release notes or something for the eventual upgrading > > of systems to 12.0. All usage of _limits stuff in custom rc scripts > > need to be audited, and all rc.conf(5)'s need to be scrubbed for > > ${name}_limits usage that doesn't make sense with the new context. I'm > > not sure what the most appropriate action here is, or what we should > > do this far ahead of time for such a thing. > > > > If this sounds like a good path forward, I'll execute #1 and #2 in the > > morning (CST, so ~11 hours from this e-mail being sent). > > > > This still doesn't fix the issue of some early start up scripts > depending on stuff that's not available yet, when for instance /usr is > on a separate FS (which was the normal way to set up a system way back > when). The words "way back when" is become less needed. With the advent of hypervisors, 100GbE and NVMe over fabric the idea of sharing /usr across a whole cluster of VM's is become more desireable. 1 copy of /usr shared from a memory file system via fast network technologies has advantages. > This issue was first noticed more than 2 years ago, so someone did > notice the breakage. It just hasn't been fixed for an entire release cycle. > Regards One thing that is not helping the bit rot is that some reworking of /etc/rc* stuff has caused it to now ignore most errors from my things, and that just causes a message on the console that no one is reading so when something gets broke it a) doesnt get noticed cause thier machine just boots, and b) doesnt get fixed cause few are actually effected by the caused error. If you are willing to help me weed out the failure modes, I am willing to try and mount an effort, along with others, to try and get us back on track. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-stable@freebsd.org Tue Apr 10 15:38:17 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12EF1F81750; Tue, 10 Apr 2018 15:38:17 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B33A06B234; Tue, 10 Apr 2018 15:38:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 93F2B77B9; Tue, 10 Apr 2018 15:38:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3AFcGO2085682; Tue, 10 Apr 2018 15:38:16 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3AFcGge085681; Tue, 10 Apr 2018 15:38:16 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804101538.w3AFcGge085681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 10 Apr 2018 15:38:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332377 - stable/11/usr.bin/truss X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/usr.bin/truss X-SVN-Commit-Revision: 332377 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 15:38:17 -0000 Author: kevans Date: Tue Apr 10 15:38:16 2018 New Revision: 332377 URL: https://svnweb.freebsd.org/changeset/base/332377 Log: MFC r328037: Rename 'recv' to 'receive' to appease shadow warnings from GCC. Modified: stable/11/usr.bin/truss/syscalls.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/truss/syscalls.c ============================================================================== --- stable/11/usr.bin/truss/syscalls.c Tue Apr 10 15:19:30 2018 (r332376) +++ stable/11/usr.bin/truss/syscalls.c Tue Apr 10 15:38:16 2018 (r332377) @@ -1291,20 +1291,20 @@ print_sctp_initmsg(FILE *fp, struct sctp_initmsg *init } static void -print_sctp_sndrcvinfo(FILE *fp, bool recv, struct sctp_sndrcvinfo *info) +print_sctp_sndrcvinfo(FILE *fp, bool receive, struct sctp_sndrcvinfo *info) { fprintf(fp, "{sid=%u,", info->sinfo_stream); - if (recv) { + if (receive) { fprintf(fp, "ssn=%u,", info->sinfo_ssn); } fputs("flgs=", fp); sysdecode_sctp_sinfo_flags(fp, info->sinfo_flags); fprintf(fp, ",ppid=%u,", ntohl(info->sinfo_ppid)); - if (!recv) { + if (!receive) { fprintf(fp, "ctx=%u,", info->sinfo_context); fprintf(fp, "ttl=%u,", info->sinfo_timetolive); } - if (recv) { + if (receive) { fprintf(fp, "tsn=%u,", info->sinfo_tsn); fprintf(fp, "cumtsn=%u,", info->sinfo_cumtsn); } @@ -1388,7 +1388,7 @@ print_sctp_ipv6_addr(FILE *fp, struct in6_addr *addr) } static void -print_sctp_cmsg(FILE *fp, bool recv, struct cmsghdr *cmsghdr) +print_sctp_cmsg(FILE *fp, bool receive, struct cmsghdr *cmsghdr) { void *data; socklen_t len; @@ -1404,7 +1404,7 @@ print_sctp_cmsg(FILE *fp, bool recv, struct cmsghdr *c break; case SCTP_SNDRCV: if (len == CMSG_LEN(sizeof(struct sctp_sndrcvinfo))) - print_sctp_sndrcvinfo(fp, recv, + print_sctp_sndrcvinfo(fp, receive, (struct sctp_sndrcvinfo *)data); else print_gen_cmsg(fp, cmsghdr); @@ -1466,7 +1466,7 @@ print_sctp_cmsg(FILE *fp, bool recv, struct cmsghdr *c } static void -print_cmsgs(FILE *fp, pid_t pid, bool recv, struct msghdr *msghdr) +print_cmsgs(FILE *fp, pid_t pid, bool receive, struct msghdr *msghdr) { struct cmsghdr *cmsghdr; char *cmsgbuf; @@ -1507,7 +1507,7 @@ print_cmsgs(FILE *fp, pid_t pid, bool recv, struct msg fputs(",data=", fp); switch (level) { case IPPROTO_SCTP: - print_sctp_cmsg(fp, recv, cmsghdr); + print_sctp_cmsg(fp, receive, cmsghdr); break; default: print_gen_cmsg(fp, cmsghdr); From owner-svn-src-stable@freebsd.org Tue Apr 10 16:44:41 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68284F85FE8; Tue, 10 Apr 2018 16:44:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1BEE07C7F7; Tue, 10 Apr 2018 16:44:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 16EE0102CD; Tue, 10 Apr 2018 16:44:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3AGieC9076007; Tue, 10 Apr 2018 16:44:40 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3AGiecB076006; Tue, 10 Apr 2018 16:44:40 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804101644.w3AGiecB076006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 10 Apr 2018 16:44:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332380 - stable/11/sys/sparc64/include X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/sparc64/include X-SVN-Commit-Revision: 332380 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 16:44:41 -0000 Author: emaste Date: Tue Apr 10 16:44:40 2018 New Revision: 332380 URL: https://svnweb.freebsd.org/changeset/base/332380 Log: MFC r318412: fix sparc64 build by restoring 'register' in pcpu.h Modified: stable/11/sys/sparc64/include/pcpu.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sparc64/include/pcpu.h ============================================================================== --- stable/11/sys/sparc64/include/pcpu.h Tue Apr 10 15:54:29 2018 (r332379) +++ stable/11/sys/sparc64/include/pcpu.h Tue Apr 10 16:44:40 2018 (r332380) @@ -71,8 +71,8 @@ extern void *dpcpu0; struct pcb; struct pcpu; -struct pcb *curpcb __asm__(__XSTRING(PCB_REG)); -struct pcpu *pcpup __asm__(__XSTRING(PCPU_REG)); +register struct pcb *curpcb __asm__(__XSTRING(PCB_REG)); +register struct pcpu *pcpup __asm__(__XSTRING(PCPU_REG)); #define PCPU_GET(member) (pcpup->pc_ ## member) From owner-svn-src-stable@freebsd.org Tue Apr 10 20:22:38 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B2FEF965C7; Tue, 10 Apr 2018 20:22:38 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3A67573A5E; Tue, 10 Apr 2018 20:22:38 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1AB8A12712; Tue, 10 Apr 2018 20:22:38 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3AKMc1Q086457; Tue, 10 Apr 2018 20:22:38 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3AKMa3m086438; Tue, 10 Apr 2018 20:22:36 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201804102022.w3AKMa3m086438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Tue, 10 Apr 2018 20:22:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332391 - in stable/11/sys: contrib/ck contrib/ck/include contrib/ck/include/gcc contrib/ck/include/gcc/sparcv9 contrib/ck/include/gcc/x86 contrib/ck/include/gcc/x86_64 contrib/ck/inclu... X-SVN-Group: stable-11 X-SVN-Commit-Author: cognet X-SVN-Commit-Paths: in stable/11/sys: contrib/ck contrib/ck/include contrib/ck/include/gcc contrib/ck/include/gcc/sparcv9 contrib/ck/include/gcc/x86 contrib/ck/include/gcc/x86_64 contrib/ck/include/spinlock contrib/ck/sr... X-SVN-Commit-Revision: 332391 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 20:22:38 -0000 Author: cognet Date: Tue Apr 10 20:22:36 2018 New Revision: 332391 URL: https://svnweb.freebsd.org/changeset/base/332391 Log: MFC r329388, r331441 and r331898, to bring the -CURRENT ck version. r329388: Define CK_MD_TSO for the relevant arches (i386, amd64 and sparc64). Defaulting to CK_MD_RMO has the unfortunate side effect of generating memory barriers that are useless on those arches, and the even more unfortunate side effect of generating lfence/sfence/mfence on i386, even if older CPUs don't support it. This should fix the panic reported when using IPFW on a Pentium 3. Note that mfence and sfence might still be used in a few case, but that shouldn't happen in FreeBSD right now, and should be fixed upstream first. r331441: In __sync_bool_compare_and_swap(), return true if the returned value is the same as the expected one, not the desired one. r331898: Import CK as of commit b19ed4c6a56ec93215ab567ba18ba61bf1cfbac8 It should fix ck_pr_[load|store]_ptr on mips and riscv, make sure no *fence instructions are used on i386, as older cpus don't support it, and make sure we don't rely on gcc builtins that can lead to calls to libatomic when linked with -O0. Modified: stable/11/sys/contrib/ck/FREEBSD-Xlist stable/11/sys/contrib/ck/include/ck_cc.h stable/11/sys/contrib/ck/include/ck_hs.h stable/11/sys/contrib/ck/include/ck_md.h stable/11/sys/contrib/ck/include/ck_pr.h stable/11/sys/contrib/ck/include/ck_queue.h stable/11/sys/contrib/ck/include/ck_ring.h stable/11/sys/contrib/ck/include/gcc/ck_cc.h stable/11/sys/contrib/ck/include/gcc/ck_pr.h stable/11/sys/contrib/ck/include/gcc/sparcv9/ck_pr.h stable/11/sys/contrib/ck/include/gcc/x86/ck_pr.h stable/11/sys/contrib/ck/include/gcc/x86_64/ck_pr.h stable/11/sys/contrib/ck/include/spinlock/dec.h stable/11/sys/contrib/ck/src/ck_hs.c stable/11/sys/contrib/ck/src/ck_ht.c stable/11/sys/contrib/ck/src/ck_ht_hash.h stable/11/sys/contrib/ck/src/ck_internal.h stable/11/sys/contrib/ck/src/ck_rhs.c stable/11/sys/mips/mips/stdatomic.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/contrib/ck/FREEBSD-Xlist ============================================================================== --- stable/11/sys/contrib/ck/FREEBSD-Xlist Tue Apr 10 19:49:04 2018 (r332390) +++ stable/11/sys/contrib/ck/FREEBSD-Xlist Tue Apr 10 20:22:36 2018 (r332391) @@ -8,4 +8,5 @@ */regressions */tools */include/ck_md.h.in +*/include/freebsd/ck_md.h.in */src/Makefile.in Modified: stable/11/sys/contrib/ck/include/ck_cc.h ============================================================================== --- stable/11/sys/contrib/ck/include/ck_cc.h Tue Apr 10 19:49:04 2018 (r332390) +++ stable/11/sys/contrib/ck/include/ck_cc.h Tue Apr 10 20:22:36 2018 (r332391) @@ -104,42 +104,36 @@ #define CK_CC_TYPEOF(X, DEFAULT) (DEFAULT) #endif +#define CK_F_CC_FFS_G(L, T) \ +CK_CC_INLINE static int \ +ck_cc_##L(T v) \ +{ \ + unsigned int i; \ + \ + if (v == 0) \ + return 0; \ + \ + for (i = 1; (v & 1) == 0; i++, v >>= 1); \ + return i; \ +} + #ifndef CK_F_CC_FFS #define CK_F_CC_FFS -CK_CC_INLINE static int -ck_cc_ffs(unsigned int x) -{ - unsigned int i; +CK_F_CC_FFS_G(ffs, unsigned int) +#endif /* CK_F_CC_FFS */ - if (x == 0) - return 0; +#ifndef CK_F_CC_FFSL +#define CK_F_CC_FFSL +CK_F_CC_FFS_G(ffsl, unsigned long) +#endif /* CK_F_CC_FFSL */ - for (i = 1; (x & 1) == 0; i++, x >>= 1); +#ifndef CK_F_CC_FFSLL +#define CK_F_CC_FFSLL +CK_F_CC_FFS_G(ffsll, unsigned long long) +#endif /* CK_F_CC_FFSLL */ - return i; -} -#endif +#undef CK_F_CC_FFS_G -#ifndef CK_F_CC_CLZ -#define CK_F_CC_CLZ -#include - -CK_CC_INLINE static int -ck_cc_clz(unsigned int x) -{ - unsigned int count, i; - - for (count = 0, i = sizeof(unsigned int) * CHAR_BIT; i > 0; count++) { - unsigned int bit = 1U << --i; - - if (x & bit) - break; - } - - return count; -} -#endif - #ifndef CK_F_CC_CTZ #define CK_F_CC_CTZ CK_CC_INLINE static int @@ -151,7 +145,6 @@ ck_cc_ctz(unsigned int x) return 0; for (i = 0; (x & 1) == 0; i++, x >>= 1); - return i; } #endif Modified: stable/11/sys/contrib/ck/include/ck_hs.h ============================================================================== --- stable/11/sys/contrib/ck/include/ck_hs.h Tue Apr 10 19:49:04 2018 (r332390) +++ stable/11/sys/contrib/ck/include/ck_hs.h Tue Apr 10 20:22:36 2018 (r332391) @@ -100,10 +100,11 @@ struct ck_hs_stat { struct ck_hs_iterator { void **cursor; unsigned long offset; + struct ck_hs_map *map; }; typedef struct ck_hs_iterator ck_hs_iterator_t; -#define CK_HS_ITERATOR_INITIALIZER { NULL, 0 } +#define CK_HS_ITERATOR_INITIALIZER { NULL, 0, NULL } /* Convenience wrapper to table hash function. */ #define CK_HS_HASH(T, F, K) F((K), (T)->seed) @@ -112,6 +113,7 @@ typedef void *ck_hs_apply_fn_t(void *, void *); bool ck_hs_apply(ck_hs_t *, unsigned long, const void *, ck_hs_apply_fn_t *, void *); void ck_hs_iterator_init(ck_hs_iterator_t *); bool ck_hs_next(ck_hs_t *, ck_hs_iterator_t *, void **); +bool ck_hs_next_spmc(ck_hs_t *, ck_hs_iterator_t *, void **); bool ck_hs_move(ck_hs_t *, ck_hs_t *, ck_hs_hash_cb_t *, ck_hs_compare_cb_t *, struct ck_malloc *); bool ck_hs_init(ck_hs_t *, unsigned int, ck_hs_hash_cb_t *, Modified: stable/11/sys/contrib/ck/include/ck_md.h ============================================================================== --- stable/11/sys/contrib/ck/include/ck_md.h Tue Apr 10 19:49:04 2018 (r332390) +++ stable/11/sys/contrib/ck/include/ck_md.h Tue Apr 10 20:22:36 2018 (r332391) @@ -1,5 +1,5 @@ /* - * Copyright 2011-2012 Samy Al Bahra. + * Copyright 2018 Samy Al Bahra. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -23,53 +23,112 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD$ + * $FreeBSD: head/sys/contrib/ck/include/ck_md.h 329388 2018-02-16 17:50:06Z cog +net $ */ +/* + * This header file is meant for use of Concurrency Kit in the FreeBSD kernel. + */ + #ifndef CK_MD_H #define CK_MD_H +#include + +#ifndef _KERNEL +#error This header file is meant for the FreeBSD kernel. +#endif /* _KERNEL */ + #ifndef CK_MD_CACHELINE +/* + * FreeBSD's CACHE_LINE macro is a compile-time maximum cache-line size for an + * architecture, defined to be 128 bytes by default on x86*. Even in presence + * of adjacent sector prefetch, this doesn't make sense from a modeling + * perspective. + */ +#if defined(__amd64__) || defined(__i386__) #define CK_MD_CACHELINE (64) -#endif +#else +#define CK_MD_CACHELINE (CACHE_LINE_SIZE) +#endif /* !__amd64__ && !__i386__ */ +#endif /* CK_MD_CACHELINE */ #ifndef CK_MD_PAGESIZE -#define CK_MD_PAGESIZE (4096) +#define CK_MD_PAGESIZE (PAGE_SIZE) #endif +/* + * Once FreeBSD has a mechanism to detect RTM, this can be enabled and RTM + * facilities can be called. These facilities refer to TSX. + */ #ifndef CK_MD_RTM_DISABLE #define CK_MD_RTM_DISABLE #endif /* CK_MD_RTM_DISABLE */ +/* + * Do not enable pointer-packing-related (VMA) optimizations in kernel-space. + */ #ifndef CK_MD_POINTER_PACK_DISABLE #define CK_MD_POINTER_PACK_DISABLE #endif /* CK_MD_POINTER_PACK_DISABLE */ -#ifndef CK_MD_VMA_BITS_UNKNOWN -#define CK_MD_VMA_BITS_UNKNOWN +/* + * The following would be used for pointer-packing tricks, disabled for the + * kernel. + */ +#ifndef CK_MD_VMA_BITS_UNKNOWN +#define CK_MD_VMA_BITS_UNKNOWN #endif /* CK_MD_VMA_BITS_UNKNOWN */ +/* + * Do not enable double operations in kernel-space. + */ #ifndef CK_PR_DISABLE_DOUBLE #define CK_PR_DISABLE_DOUBLE #endif /* CK_PR_DISABLE_DOUBLE */ -#ifndef CK_MD_RMO -#define CK_MD_RMO -#endif /* CK_MD_RMO */ +/* + * If building for a uni-processor target, then enable the uniprocessor + * feature flag. This, among other things, will remove the lock prefix. + */ +#ifndef SMP +#define CK_MD_UMP +#endif /* SMP */ -#define CK_VERSION "0.6.0" -#define CK_GIT_SHA "" +/* + * Disable the use of compiler builtin functions. + */ +#define CK_MD_CC_BUILTIN_DISABLE 1 /* * CK expects those, which are normally defined by the build system. */ #if defined(__i386__) && !defined(__x86__) #define __x86__ +/* + * If x86 becomes more relevant, we may want to consider importing in + * __mbk() to avoid potential issues around false sharing. + */ +#define CK_MD_TSO +#define CK_MD_SSE_DISABLE 1 +#elif defined(__amd64__) +#define CK_MD_TSO #elif defined(__sparc64__) && !defined(__sparcv9__) #define __sparcv9__ +#define CK_MD_TSO #elif defined(__powerpc64__) && !defined(__ppc64__) #define __ppc64__ #elif defined(__powerpc__) && !defined(__ppc__) #define __ppc__ #endif + +/* If no memory model has been defined, assume RMO. */ +#if !defined(CK_MD_RMO) && !defined(CK_MD_TSO) && !defined(CK_MD_PSO) +#define CK_MD_RMO +#endif + +#define CK_VERSION "0.7.0" +#define CK_GIT_SHA "db5db44" + #endif /* CK_MD_H */ Modified: stable/11/sys/contrib/ck/include/ck_pr.h ============================================================================== --- stable/11/sys/contrib/ck/include/ck_pr.h Tue Apr 10 19:49:04 2018 (r332390) +++ stable/11/sys/contrib/ck/include/ck_pr.h Tue Apr 10 20:22:36 2018 (r332391) @@ -43,6 +43,8 @@ #include "gcc/sparcv9/ck_pr.h" #elif defined(__ppc64__) #include "gcc/ppc64/ck_pr.h" +#elif defined(__s390x__) +#include "gcc/s390x/ck_pr.h" #elif defined(__ppc__) #include "gcc/ppc/ck_pr.h" #elif defined(__arm__) Modified: stable/11/sys/contrib/ck/include/ck_queue.h ============================================================================== --- stable/11/sys/contrib/ck/include/ck_queue.h Tue Apr 10 19:49:04 2018 (r332390) +++ stable/11/sys/contrib/ck/include/ck_queue.h Tue Apr 10 20:22:36 2018 (r332391) @@ -235,7 +235,7 @@ struct { \ * Singly-linked Tail queue functions. */ #define CK_STAILQ_CONCAT(head1, head2) do { \ - if ((head2)->stqh_first == NULL) { \ + if ((head2)->stqh_first != NULL) { \ ck_pr_store_ptr((head1)->stqh_last, (head2)->stqh_first); \ ck_pr_fence_store(); \ (head1)->stqh_last = (head2)->stqh_last; \ Modified: stable/11/sys/contrib/ck/include/ck_ring.h ============================================================================== --- stable/11/sys/contrib/ck/include/ck_ring.h Tue Apr 10 19:49:04 2018 (r332390) +++ stable/11/sys/contrib/ck/include/ck_ring.h Tue Apr 10 20:22:36 2018 (r332391) @@ -176,23 +176,54 @@ _ck_ring_enqueue_mp(struct ck_ring *ring, producer = ck_pr_load_uint(&ring->p_head); - do { + for (;;) { /* - * The snapshot of producer must be up to date with - * respect to consumer. + * The snapshot of producer must be up to date with respect to + * consumer. */ ck_pr_fence_load(); consumer = ck_pr_load_uint(&ring->c_head); delta = producer + 1; - if (CK_CC_UNLIKELY((delta & mask) == (consumer & mask))) { - r = false; - goto leave; + + /* + * Only try to CAS if the producer is not clearly stale (not + * less than consumer) and the buffer is definitely not full. + */ + if (CK_CC_LIKELY((producer - consumer) < mask)) { + if (ck_pr_cas_uint_value(&ring->p_head, + producer, delta, &producer) == true) { + break; + } + } else { + unsigned int new_producer; + + /* + * Slow path. Either the buffer is full or we have a + * stale snapshot of p_head. Execute a second read of + * p_read that must be ordered wrt the snapshot of + * c_head. + */ + ck_pr_fence_load(); + new_producer = ck_pr_load_uint(&ring->p_head); + + /* + * Only fail if we haven't made forward progress in + * production: the buffer must have been full when we + * read new_producer (or we wrapped around UINT_MAX + * during this iteration). + */ + if (producer == new_producer) { + r = false; + goto leave; + } + + /* + * p_head advanced during this iteration. Try again. + */ + producer = new_producer; } - } while (ck_pr_cas_uint_value(&ring->p_head, - producer, - delta, - &producer) == false); + } buffer = (char *)buffer + ts * (producer & mask); memcpy(buffer, entry, ts); Modified: stable/11/sys/contrib/ck/include/gcc/ck_cc.h ============================================================================== --- stable/11/sys/contrib/ck/include/gcc/ck_cc.h Tue Apr 10 19:49:04 2018 (r332390) +++ stable/11/sys/contrib/ck/include/gcc/ck_cc.h Tue Apr 10 20:22:36 2018 (r332391) @@ -103,28 +103,26 @@ #define CK_CC_TYPEOF(X, DEFAULT) __typeof__(X) /* - * Portability wrappers for bitwise ops. + * Portability wrappers for bitwise operations. */ - +#ifndef CK_MD_CC_BUILTIN_DISABLE #define CK_F_CC_FFS -#define CK_F_CC_CLZ -#define CK_F_CC_CTZ -#define CK_F_CC_POPCOUNT - CK_CC_INLINE static int ck_cc_ffs(unsigned int x) { - return __builtin_ffs(x); + return __builtin_ffsl(x); } +#define CK_F_CC_FFSL CK_CC_INLINE static int -ck_cc_clz(unsigned int x) +ck_cc_ffsl(unsigned long x) { - return __builtin_clz(x); + return __builtin_ffsll(x); } +#define CK_F_CC_CTZ CK_CC_INLINE static int ck_cc_ctz(unsigned int x) { @@ -132,11 +130,12 @@ ck_cc_ctz(unsigned int x) return __builtin_ctz(x); } +#define CK_F_CC_POPCOUNT CK_CC_INLINE static int ck_cc_popcount(unsigned int x) { return __builtin_popcount(x); } - +#endif /* CK_MD_CC_BUILTIN_DISABLE */ #endif /* CK_GCC_CC_H */ Modified: stable/11/sys/contrib/ck/include/gcc/ck_pr.h ============================================================================== --- stable/11/sys/contrib/ck/include/gcc/ck_pr.h Tue Apr 10 19:49:04 2018 (r332390) +++ stable/11/sys/contrib/ck/include/gcc/ck_pr.h Tue Apr 10 20:22:36 2018 (r332391) @@ -80,7 +80,7 @@ ck_pr_md_load_ptr(const void *target) void *r; ck_pr_barrier(); - r = CK_CC_DECONST_PTR(CK_PR_ACCESS(target)); + r = CK_CC_DECONST_PTR(*(volatile void *const*)(target)); ck_pr_barrier(); return r; @@ -91,7 +91,7 @@ ck_pr_md_store_ptr(void *target, const void *v) { ck_pr_barrier(); - CK_PR_ACCESS(target) = CK_CC_DECONST_PTR(v); + *(volatile void **)target = CK_CC_DECONST_PTR(v); ck_pr_barrier(); return; } Modified: stable/11/sys/contrib/ck/include/gcc/sparcv9/ck_pr.h ============================================================================== --- stable/11/sys/contrib/ck/include/gcc/sparcv9/ck_pr.h Tue Apr 10 19:49:04 2018 (r332390) +++ stable/11/sys/contrib/ck/include/gcc/sparcv9/ck_pr.h Tue Apr 10 20:22:36 2018 (r332391) @@ -76,7 +76,7 @@ CK_PR_FENCE(store, "membar #StoreStore") CK_PR_FENCE(store_load, "membar #StoreLoad") CK_PR_FENCE(load, "membar #LoadLoad") CK_PR_FENCE(load_store, "membar #LoadStore") -CK_PR_FENCE(memory, "membar #LoadLoad | #LoadStore | #StoreStore | #StoreLoad") +CK_PR_FENCE(memory, "membar #MemIssue") CK_PR_FENCE(acquire, "membar #LoadLoad | #LoadStore") CK_PR_FENCE(release, "membar #LoadStore | #StoreStore") CK_PR_FENCE(acqrel, "membar #LoadLoad | #LoadStore | #StoreStore") Modified: stable/11/sys/contrib/ck/include/gcc/x86/ck_pr.h ============================================================================== --- stable/11/sys/contrib/ck/include/gcc/x86/ck_pr.h Tue Apr 10 19:49:04 2018 (r332390) +++ stable/11/sys/contrib/ck/include/gcc/x86/ck_pr.h Tue Apr 10 20:22:36 2018 (r332391) @@ -45,15 +45,9 @@ /* Minimum requirements for the CK_PR interface are met. */ #define CK_F_PR -#ifdef CK_MD_UMP -#define CK_PR_LOCK_PREFIX -#else -#define CK_PR_LOCK_PREFIX "lock " -#endif - /* - * Prevent speculative execution in busy-wait loops (P4 <=) - * or "predefined delay". + * Prevent speculative execution in busy-wait loops (P4 <=) or "predefined + * delay". */ CK_CC_INLINE static void ck_pr_stall(void) @@ -62,28 +56,52 @@ ck_pr_stall(void) return; } +#ifdef CK_MD_UMP +#define CK_PR_LOCK_PREFIX #define CK_PR_FENCE(T, I) \ CK_CC_INLINE static void \ ck_pr_fence_strict_##T(void) \ { \ + __asm__ __volatile__("" ::: "memory"); \ + return; \ + } +#else +#define CK_PR_LOCK_PREFIX "lock " +#define CK_PR_FENCE(T, I) \ + CK_CC_INLINE static void \ + ck_pr_fence_strict_##T(void) \ + { \ __asm__ __volatile__(I ::: "memory"); \ + return; \ } +#endif /* CK_MD_UMP */ -CK_PR_FENCE(atomic, "sfence") -CK_PR_FENCE(atomic_store, "sfence") -CK_PR_FENCE(atomic_load, "mfence") -CK_PR_FENCE(store_atomic, "sfence") -CK_PR_FENCE(load_atomic, "mfence") -CK_PR_FENCE(load, "lfence") -CK_PR_FENCE(load_store, "mfence") -CK_PR_FENCE(store, "sfence") -CK_PR_FENCE(store_load, "mfence") -CK_PR_FENCE(memory, "mfence") -CK_PR_FENCE(release, "mfence") -CK_PR_FENCE(acquire, "mfence") -CK_PR_FENCE(acqrel, "mfence") -CK_PR_FENCE(lock, "mfence") -CK_PR_FENCE(unlock, "mfence") +#if defined(CK_MD_SSE_DISABLE) +/* If SSE is disabled, then use atomic operations for serialization. */ +#define CK_MD_X86_MFENCE "lock addl $0, (%%esp)" +#define CK_MD_X86_SFENCE CK_MD_X86_MFENCE +#define CK_MD_X86_LFENCE CK_MD_X86_MFENCE +#else +#define CK_MD_X86_SFENCE "sfence" +#define CK_MD_X86_LFENCE "lfence" +#define CK_MD_X86_MFENCE "mfence" +#endif /* !CK_MD_SSE_DISABLE */ + +CK_PR_FENCE(atomic, "") +CK_PR_FENCE(atomic_store, "") +CK_PR_FENCE(atomic_load, "") +CK_PR_FENCE(store_atomic, "") +CK_PR_FENCE(load_atomic, "") +CK_PR_FENCE(load, CK_MD_X86_LFENCE) +CK_PR_FENCE(load_store, CK_MD_X86_MFENCE) +CK_PR_FENCE(store, CK_MD_X86_SFENCE) +CK_PR_FENCE(store_load, CK_MD_X86_MFENCE) +CK_PR_FENCE(memory, CK_MD_X86_MFENCE) +CK_PR_FENCE(release, CK_MD_X86_MFENCE) +CK_PR_FENCE(acquire, CK_MD_X86_MFENCE) +CK_PR_FENCE(acqrel, CK_MD_X86_MFENCE) +CK_PR_FENCE(lock, CK_MD_X86_MFENCE) +CK_PR_FENCE(unlock, CK_MD_X86_MFENCE) #undef CK_PR_FENCE Modified: stable/11/sys/contrib/ck/include/gcc/x86_64/ck_pr.h ============================================================================== --- stable/11/sys/contrib/ck/include/gcc/x86_64/ck_pr.h Tue Apr 10 19:49:04 2018 (r332390) +++ stable/11/sys/contrib/ck/include/gcc/x86_64/ck_pr.h Tue Apr 10 20:22:36 2018 (r332391) @@ -58,8 +58,8 @@ #endif /* - * Prevent speculative execution in busy-wait loops (P4 <=) - * or "predefined delay". + * Prevent speculative execution in busy-wait loops (P4 <=) or "predefined + * delay". */ CK_CC_INLINE static void ck_pr_stall(void) @@ -75,18 +75,39 @@ ck_pr_stall(void) __asm__ __volatile__(I ::: "memory"); \ } -CK_PR_FENCE(atomic, "sfence") -CK_PR_FENCE(atomic_store, "sfence") -CK_PR_FENCE(atomic_load, "mfence") -CK_PR_FENCE(store_atomic, "sfence") -CK_PR_FENCE(load_atomic, "mfence") +/* Atomic operations are always serializing. */ +CK_PR_FENCE(atomic, "") +CK_PR_FENCE(atomic_store, "") +CK_PR_FENCE(atomic_load, "") +CK_PR_FENCE(store_atomic, "") +CK_PR_FENCE(load_atomic, "") + +/* Traditional fence interface. */ CK_PR_FENCE(load, "lfence") CK_PR_FENCE(load_store, "mfence") CK_PR_FENCE(store, "sfence") CK_PR_FENCE(store_load, "mfence") CK_PR_FENCE(memory, "mfence") + +/* Below are stdatomic-style fences. */ + +/* + * Provides load-store and store-store ordering. However, Intel specifies that + * the WC memory model is relaxed. It is likely an sfence *is* sufficient (in + * particular, stores are not re-ordered with respect to prior loads and it is + * really just the stores that are subject to re-ordering). However, we take + * the conservative route as the manuals are too ambiguous for my taste. + */ CK_PR_FENCE(release, "mfence") + +/* + * Provides load-load and load-store ordering. The lfence instruction ensures + * all prior load operations are complete before any subsequent instructions + * actually begin execution. However, the manual also ends up going to describe + * WC memory as a relaxed model. + */ CK_PR_FENCE(acquire, "mfence") + CK_PR_FENCE(acqrel, "mfence") CK_PR_FENCE(lock, "mfence") CK_PR_FENCE(unlock, "mfence") Modified: stable/11/sys/contrib/ck/include/spinlock/dec.h ============================================================================== --- stable/11/sys/contrib/ck/include/spinlock/dec.h Tue Apr 10 19:49:04 2018 (r332390) +++ stable/11/sys/contrib/ck/include/spinlock/dec.h Tue Apr 10 20:22:36 2018 (r332391) @@ -111,7 +111,8 @@ ck_spinlock_dec_lock_eb(struct ck_spinlock_dec *lock) if (r == true) break; - ck_backoff_eb(&backoff); + while (ck_pr_load_uint(&lock->value) != 1) + ck_backoff_eb(&backoff); } ck_pr_fence_lock(); Modified: stable/11/sys/contrib/ck/src/ck_hs.c ============================================================================== --- stable/11/sys/contrib/ck/src/ck_hs.c Tue Apr 10 19:49:04 2018 (r332390) +++ stable/11/sys/contrib/ck/src/ck_hs.c Tue Apr 10 20:22:36 2018 (r332391) @@ -105,21 +105,10 @@ ck_hs_map_signal(struct ck_hs_map *map, unsigned long return; } -void -ck_hs_iterator_init(struct ck_hs_iterator *iterator) +static bool +_ck_hs_next(struct ck_hs *hs, struct ck_hs_map *map, struct ck_hs_iterator *i, void **key) { - - iterator->cursor = NULL; - iterator->offset = 0; - return; -} - -bool -ck_hs_next(struct ck_hs *hs, struct ck_hs_iterator *i, void **key) -{ - struct ck_hs_map *map = hs->map; void *value; - if (i->offset >= map->capacity) return false; @@ -129,6 +118,8 @@ ck_hs_next(struct ck_hs *hs, struct ck_hs_iterator *i, #ifdef CK_HS_PP if (hs->mode & CK_HS_MODE_OBJECT) value = CK_HS_VMA(value); +#else + (void)hs; /* Avoid unused parameter warning. */ #endif i->offset++; *key = value; @@ -140,6 +131,32 @@ ck_hs_next(struct ck_hs *hs, struct ck_hs_iterator *i, } void +ck_hs_iterator_init(struct ck_hs_iterator *iterator) +{ + + iterator->cursor = NULL; + iterator->offset = 0; + iterator->map = NULL; + return; +} + +bool +ck_hs_next(struct ck_hs *hs, struct ck_hs_iterator *i, void **key) +{ + return _ck_hs_next(hs, hs->map, i, key); +} + +bool +ck_hs_next_spmc(struct ck_hs *hs, struct ck_hs_iterator *i, void **key) +{ + struct ck_hs_map *m = i->map; + if (m == NULL) { + m = i->map = ck_pr_load_ptr(&hs->map); + } + return _ck_hs_next(hs, m, i, key); +} + +void ck_hs_stat(struct ck_hs *hs, struct ck_hs_stat *st) { struct ck_hs_map *map = hs->map; @@ -206,7 +223,7 @@ ck_hs_map_create(struct ck_hs *hs, unsigned long entri map->probe_limit = (unsigned int)limit; map->probe_maximum = 0; map->capacity = n_entries; - map->step = ck_internal_bsf(n_entries); + map->step = ck_cc_ffsl(n_entries); map->mask = n_entries - 1; map->n_entries = 0; Modified: stable/11/sys/contrib/ck/src/ck_ht.c ============================================================================== --- stable/11/sys/contrib/ck/src/ck_ht.c Tue Apr 10 19:49:04 2018 (r332390) +++ stable/11/sys/contrib/ck/src/ck_ht.c Tue Apr 10 20:22:36 2018 (r332391) @@ -171,7 +171,7 @@ ck_ht_map_create(struct ck_ht *table, CK_HT_TYPE entri map->deletions = 0; map->probe_maximum = 0; map->capacity = n_entries; - map->step = ck_internal_bsf_64(map->capacity); + map->step = ck_cc_ffsll(map->capacity); map->mask = map->capacity - 1; map->n_entries = 0; map->entries = (struct ck_ht_entry *)(((uintptr_t)&map[1] + prefix + Modified: stable/11/sys/contrib/ck/src/ck_ht_hash.h ============================================================================== --- stable/11/sys/contrib/ck/src/ck_ht_hash.h Tue Apr 10 19:49:04 2018 (r332390) +++ stable/11/sys/contrib/ck/src/ck_ht_hash.h Tue Apr 10 20:22:36 2018 (r332391) @@ -88,7 +88,15 @@ static inline uint64_t rotl64 ( uint64_t x, int8_t r ) FORCE_INLINE static uint32_t getblock ( const uint32_t * p, int i ) { +#ifdef __s390x__ + uint32_t res; + + __asm__ (" lrv %0,%1\n" + : "=r" (res) : "Q" (p[i]) : "cc", "mem"); + return res; +#else return p[i]; +#endif /* !__s390x__ */ } //----------------------------------------------------------------------------- @@ -147,7 +155,9 @@ static inline void MurmurHash3_x86_32 ( const void * k switch(len & 3) { case 3: k1 ^= tail[2] << 16; + /* fall through */ case 2: k1 ^= tail[1] << 8; + /* fall through */ case 1: k1 ^= tail[0]; k1 *= c1; k1 = ROTL32(k1,15); k1 *= c2; h1 ^= k1; }; @@ -196,11 +206,17 @@ static inline uint64_t MurmurHash64A ( const void * ke switch(len & 7) { case 7: h ^= (uint64_t)(data2[6]) << 48; + /* fall through */ case 6: h ^= (uint64_t)(data2[5]) << 40; + /* fall through */ case 5: h ^= (uint64_t)(data2[4]) << 32; + /* fall through */ case 4: h ^= (uint64_t)(data2[3]) << 24; + /* fall through */ case 3: h ^= (uint64_t)(data2[2]) << 16; + /* fall through */ case 2: h ^= (uint64_t)(data2[1]) << 8; + /* fall through */ case 1: h ^= (uint64_t)(data2[0]); h *= m; }; @@ -249,7 +265,9 @@ static inline uint64_t MurmurHash64B ( const void * ke switch(len) { case 3: h2 ^= ((const unsigned char*)data)[2] << 16; + /* fall through */ case 2: h2 ^= ((const unsigned char*)data)[1] << 8; + /* fall through */ case 1: h2 ^= ((const unsigned char*)data)[0]; h2 *= m; }; Modified: stable/11/sys/contrib/ck/src/ck_internal.h ============================================================================== --- stable/11/sys/contrib/ck/src/ck_internal.h Tue Apr 10 19:49:04 2018 (r332390) +++ stable/11/sys/contrib/ck/src/ck_internal.h Tue Apr 10 20:22:36 2018 (r332391) @@ -80,40 +80,3 @@ ck_internal_max_32(uint32_t x, uint32_t y) return x ^ ((x ^ y) & -(x < y)); } - -CK_CC_INLINE static unsigned long -ck_internal_bsf(unsigned long v) -{ -#if defined(__GNUC__) - return __builtin_ffs(v); -#else - unsigned int i; - const unsigned int s = sizeof(unsigned long) * 8 - 1; - - for (i = 0; i < s; i++) { - if (v & (1UL << (s - i))) - return sizeof(unsigned long) * 8 - i; - } - - return 1; -#endif /* !__GNUC__ */ -} - -CK_CC_INLINE static uint64_t -ck_internal_bsf_64(uint64_t v) -{ -#if defined(__GNUC__) - return __builtin_ffs(v); -#else - unsigned int i; - const unsigned int s = sizeof(unsigned long) * 8 - 1; - - for (i = 0; i < s; i++) { - if (v & (1ULL << (63U - i))) - return i; - } -#endif /* !__GNUC__ */ - - return 1; -} - Modified: stable/11/sys/contrib/ck/src/ck_rhs.c ============================================================================== --- stable/11/sys/contrib/ck/src/ck_rhs.c Tue Apr 10 19:49:04 2018 (r332390) +++ stable/11/sys/contrib/ck/src/ck_rhs.c Tue Apr 10 20:22:36 2018 (r332391) @@ -366,7 +366,7 @@ ck_rhs_map_create(struct ck_rhs *hs, unsigned long ent map->probe_limit = (unsigned int)limit; map->probe_maximum = 0; map->capacity = n_entries; - map->step = ck_internal_bsf(n_entries); + map->step = ck_cc_ffsl(n_entries); map->mask = n_entries - 1; map->n_entries = 0; Modified: stable/11/sys/mips/mips/stdatomic.c ============================================================================== --- stable/11/sys/mips/mips/stdatomic.c Tue Apr 10 19:49:04 2018 (r332390) +++ stable/11/sys/mips/mips/stdatomic.c Tue Apr 10 20:22:36 2018 (r332391) @@ -325,7 +325,7 @@ __sync_bool_compare_and_swap_4(uint32_t *mem, uint32_t { return (do_compare_and_swap_4(mem, expected, desired) == - desired); + expected); } #define EMIT_FETCH_AND_OP_4(name, op) \ From owner-svn-src-stable@freebsd.org Tue Apr 10 23:38:32 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A84EFA3DA6; Tue, 10 Apr 2018 23:38:32 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1CBC07FE1E; Tue, 10 Apr 2018 23:38:32 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 17BA714681; Tue, 10 Apr 2018 23:38:32 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3ANcVg5080758; Tue, 10 Apr 2018 23:38:31 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3ANcVrJ080757; Tue, 10 Apr 2018 23:38:31 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804102338.w3ANcVrJ080757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 10 Apr 2018 23:38:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332397 - stable/11/contrib/bsnmp/lib X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/contrib/bsnmp/lib X-SVN-Commit-Revision: 332397 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 23:38:32 -0000 Author: emaste Date: Tue Apr 10 23:38:31 2018 New Revision: 332397 URL: https://svnweb.freebsd.org/changeset/base/332397 Log: MFC r308490 by syrinx: Reply to a snmpEngineID discovery PDU with a Report PDU as per the requirements of RFC 3414 section 4. PR: 174974 Submitted by: pguyot@kallisys.net Modified: stable/11/contrib/bsnmp/lib/snmpagent.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/lib/snmpagent.c ============================================================================== --- stable/11/contrib/bsnmp/lib/snmpagent.c Tue Apr 10 23:29:57 2018 (r332396) +++ stable/11/contrib/bsnmp/lib/snmpagent.c Tue Apr 10 23:38:31 2018 (r332397) @@ -171,7 +171,10 @@ snmp_pdu_create_response(const struct snmp_pdu *pdu, s memset(resp, 0, sizeof(*resp)); strcpy(resp->community, pdu->community); resp->version = pdu->version; - resp->type = SNMP_PDU_RESPONSE; + if (pdu->flags & SNMP_MSG_AUTODISCOVER) + resp->type = SNMP_PDU_REPORT; /* RFC 3414.4 */ + else + resp->type = SNMP_PDU_RESPONSE; resp->request_id = pdu->request_id; resp->version = pdu->version; From owner-svn-src-stable@freebsd.org Wed Apr 11 10:24:48 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDF91F871BC; Wed, 11 Apr 2018 10:24:47 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 909696A956; Wed, 11 Apr 2018 10:24:47 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8755F1AF7B; Wed, 11 Apr 2018 10:24:47 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3BAOl9H004673; Wed, 11 Apr 2018 10:24:47 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3BAOl1j004671; Wed, 11 Apr 2018 10:24:47 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201804111024.w3BAOl1j004671@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 11 Apr 2018 10:24:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332400 - stable/11/sbin/ipfw X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/11/sbin/ipfw X-SVN-Commit-Revision: 332400 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 10:24:48 -0000 Author: ae Date: Wed Apr 11 10:24:47 2018 New Revision: 332400 URL: https://svnweb.freebsd.org/changeset/base/332400 Log: MFC r331668: Rework ipfw rules parsing and printing code. Introduce show_state structure to keep information about printed opcodes. Split show_static_rule() function into several smaller functions. Make parsing and printing opcodes into several passes. Each printed opcode is marked in show_state structure and will be skipped in next passes. Now show_static_rule() function is simple, it just prints each part of rule separately: action, modifiers, proto, src and dst addresses, options. The main goal of this change is avoiding occurrence of wrong result of `ifpw show` command, that can not be parsed by ipfw(8). Also now it is possible to make some simple static optimizations by reordering of opcodes in the rule. PR: 222705 Modified: stable/11/sbin/ipfw/ipfw2.c stable/11/sbin/ipfw/ipfw2.h stable/11/sbin/ipfw/main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/ipfw/ipfw2.c ============================================================================== --- stable/11/sbin/ipfw/ipfw2.c Wed Apr 11 07:15:30 2018 (r332399) +++ stable/11/sbin/ipfw/ipfw2.c Wed Apr 11 10:24:47 2018 (r332400) @@ -1176,7 +1176,7 @@ print_flags(struct buf_pr *bp, char const *name, ipfw_ * Print the ip address contained in a command. */ static void -print_ip(struct buf_pr *bp, struct format_opts *fo, ipfw_insn_ip *cmd, +print_ip(struct buf_pr *bp, const struct format_opts *fo, ipfw_insn_ip *cmd, char const *s) { struct hostent *he = NULL; @@ -1277,7 +1277,7 @@ print_ip(struct buf_pr *bp, struct format_opts *fo, ip * prints a MAC address/mask pair */ static void -print_mac(struct buf_pr *bp, uint8_t *addr, uint8_t *mask) +format_mac(struct buf_pr *bp, uint8_t *addr, uint8_t *mask) { int l = contigmask(mask, 48); @@ -1296,6 +1296,15 @@ print_mac(struct buf_pr *bp, uint8_t *addr, uint8_t *m } static void +print_mac(struct buf_pr *bp, ipfw_insn_mac *mac) +{ + + bprintf(bp, " MAC"); + format_mac(bp, mac->addr, mac->mask); + format_mac(bp, mac->addr + 6, mac->mask + 6); +} + +static void fill_icmptypes(ipfw_insn_u32 *cmd, char *av) { uint8_t type; @@ -1358,817 +1367,843 @@ print_dscp(struct buf_pr *bp, ipfw_insn_u32 *cmd) } } -/* - * show_ipfw() prints the body of an ipfw rule. - * Because the standard rule has at least proto src_ip dst_ip, we use - * a helper function to produce these entries if not provided explicitly. - * The first argument is the list of fields we have, the second is - * the list of fields we want to be printed. - * - * Special cases if we have provided a MAC header: - * + if the rule does not contain IP addresses/ports, do not print them; - * + if the rule does not contain an IP proto, print "all" instead of "ip"; - * - * Once we have 'have_options', IP header fields are printed as options. - */ +#define insntod(cmd, type) ((ipfw_insn_ ## type *)(cmd)) +struct show_state { + struct ip_fw_rule *rule; + const ipfw_insn *eaction; + uint8_t *printed; + int flags; #define HAVE_PROTO 0x0001 #define HAVE_SRCIP 0x0002 #define HAVE_DSTIP 0x0004 -#define HAVE_PROTO4 0x0008 -#define HAVE_PROTO6 0x0010 -#define HAVE_IP 0x0100 -#define HAVE_OPTIONS 0x8000 + int proto; + int or_block; +}; -static void -show_prerequisites(struct buf_pr *bp, int *flags, int want, int cmd) +static int +init_show_state(struct show_state *state, struct ip_fw_rule *rule) { - (void)cmd; /* UNUSED */ - if (co.comment_only) - return; - if ( (*flags & HAVE_IP) == HAVE_IP) - *flags |= HAVE_OPTIONS; - if ( !(*flags & HAVE_OPTIONS)) { - if ( !(*flags & HAVE_PROTO) && (want & HAVE_PROTO)) { - if ( (*flags & HAVE_PROTO4)) - bprintf(bp, " ip4"); - else if ( (*flags & HAVE_PROTO6)) - bprintf(bp, " ip6"); - else - bprintf(bp, " ip"); - } - if ( !(*flags & HAVE_SRCIP) && (want & HAVE_SRCIP)) - bprintf(bp, " from any"); - if ( !(*flags & HAVE_DSTIP) && (want & HAVE_DSTIP)) - bprintf(bp, " to any"); - } - *flags |= want; + state->printed = calloc(rule->cmd_len, sizeof(uint8_t)); + if (state->printed == NULL) + return (ENOMEM); + state->rule = rule; + state->eaction = NULL; + state->flags = 0; + state->proto = 0; + state->or_block = 0; + return (0); } static void -show_static_rule(struct cmdline_opts *co, struct format_opts *fo, - struct buf_pr *bp, struct ip_fw_rule *rule, struct ip_fw_bcounter *cntr) +free_show_state(struct show_state *state) { - static int twidth = 0; - int l; - ipfw_insn *cmd, *has_eaction = NULL, *tagptr = NULL; - const char *comment = NULL; /* ptr to comment if we have one */ - const char *ename; - int proto = 0; /* default */ - int flags = 0; /* prerequisites */ - ipfw_insn_log *logptr = NULL; /* set if we find an O_LOG */ - ipfw_insn_altq *altqptr = NULL; /* set if we find an O_ALTQ */ - int or_block = 0; /* we are in an or block */ - uint32_t uval; - if ((fo->set_mask & (1 << rule->set)) == 0) { - /* disabled mask */ - if (!co->show_sets) - return; - else - bprintf(bp, "# DISABLED "); - } - bprintf(bp, "%05u ", rule->rulenum); + free(state->printed); +} - /* Print counters if enabled */ - if (fo->pcwidth > 0 || fo->bcwidth > 0) { - pr_u64(bp, &cntr->pcnt, fo->pcwidth); - pr_u64(bp, &cntr->bcnt, fo->bcwidth); - } +static uint8_t +is_printed_opcode(struct show_state *state, const ipfw_insn *cmd) +{ - if (co->do_time == 2) - bprintf(bp, "%10u ", cntr->timestamp); - else if (co->do_time == 1) { - char timestr[30]; - time_t t = (time_t)0; + return (state->printed[cmd - state->rule->cmd]); +} - if (twidth == 0) { - strcpy(timestr, ctime(&t)); - *strchr(timestr, '\n') = '\0'; - twidth = strlen(timestr); - } - if (cntr->timestamp > 0) { - t = _long_to_time(cntr->timestamp); +static void +mark_printed(struct show_state *state, const ipfw_insn *cmd) +{ - strcpy(timestr, ctime(&t)); - *strchr(timestr, '\n') = '\0'; - bprintf(bp, "%s ", timestr); - } else { - bprintf(bp, "%*s", twidth, " "); - } - } + state->printed[cmd - state->rule->cmd] = 1; +} - if (co->show_sets) - bprintf(bp, "set %d ", rule->set); +static void +print_limit(struct buf_pr *bp, const ipfw_insn_limit *limit) +{ + struct _s_x *p = limit_masks; + char const *comma = " "; + uint8_t x; - /* - * print the optional "match probability" - */ - if (rule->cmd_len > 0) { - cmd = rule->cmd ; - if (cmd->opcode == O_PROB) { - ipfw_insn_u32 *p = (ipfw_insn_u32 *)cmd; - double d = 1.0 * p->d[0]; - - d = (d / 0x7fffffff); - bprintf(bp, "prob %f ", d); + bprintf(bp, " limit"); + for (x = limit->limit_mask; p->x != 0; p++) { + if ((x & p->x) == p->x) { + x &= ~p->x; + bprintf(bp, "%s%s", comma, p->s); + comma = ","; } } + bprint_uint_arg(bp, " ", limit->conn_limit); +} - /* - * first print actions - */ - for (l = rule->cmd_len - rule->act_ofs, cmd = ACTION_PTR(rule); - l > 0 ; l -= F_LEN(cmd), cmd += F_LEN(cmd)) { - switch(cmd->opcode) { - case O_CHECK_STATE: - bprintf(bp, "check-state"); - if (cmd->arg1 != 0) - ename = object_search_ctlv(fo->tstate, - cmd->arg1, IPFW_TLV_STATE_NAME); - else - ename = NULL; - bprintf(bp, " :%s", ename ? ename: "any"); - /* avoid printing anything else */ - flags = HAVE_PROTO | HAVE_SRCIP | - HAVE_DSTIP | HAVE_IP; - break; +static int +print_instruction(struct buf_pr *bp, const struct format_opts *fo, + struct show_state *state, ipfw_insn *cmd) +{ + struct protoent *pe; + struct passwd *pwd; + struct group *grp; + const char *s; + double d; - case O_ACCEPT: - bprintf(bp, "allow"); - break; + if (is_printed_opcode(state, cmd)) + return (0); + if ((cmd->len & F_OR) != 0 && state->or_block == 0) + bprintf(bp, " {"); + if (cmd->opcode != O_IN && (cmd->len & F_NOT) != 0) + bprintf(bp, " not"); - case O_COUNT: - bprintf(bp, "count"); + switch (cmd->opcode) { + case O_PROB: + d = 1.0 * insntod(cmd, u32)->d[0] / 0x7fffffff; + bprintf(bp, "prob %f ", d); + break; + case O_PROBE_STATE: /* no need to print anything here */ + break; + case O_IP_SRC: + case O_IP_SRC_LOOKUP: + case O_IP_SRC_MASK: + case O_IP_SRC_ME: + case O_IP_SRC_SET: + case O_IP_DST: + case O_IP_DST_LOOKUP: + case O_IP_DST_MASK: + case O_IP_DST_ME: + case O_IP_DST_SET: + print_ip(bp, fo, insntod(cmd, ip), ""); + break; + case O_IP6_SRC: + case O_IP6_SRC_MASK: + case O_IP6_SRC_ME: + case O_IP6_DST: + case O_IP6_DST_MASK: + case O_IP6_DST_ME: + print_ip6(bp, insntod(cmd, ip6), ""); + break; + case O_FLOW6ID: + print_flow6id(bp, insntod(cmd, u32)); + break; + case O_IP_DSTPORT: + case O_IP_SRCPORT: + print_newports(bp, insntod(cmd, u16), state->proto, + (state->flags & (HAVE_SRCIP | HAVE_DSTIP)) == + (HAVE_SRCIP | HAVE_DSTIP) ? cmd->opcode: 0); + break; + case O_PROTO: + pe = getprotobynumber(cmd->arg1); + if (state->flags & HAVE_PROTO) + bprintf(bp, " proto"); + if (pe != NULL) + bprintf(bp, " %s", pe->p_name); + else + bprintf(bp, " %u", cmd->arg1); + break; + case O_MACADDR2: + print_mac(bp, insntod(cmd, mac)); + break; + case O_MAC_TYPE: + print_newports(bp, insntod(cmd, u16), + IPPROTO_ETHERTYPE, cmd->opcode); + break; + case O_FRAG: + bprintf(bp, " frag"); + break; + case O_FIB: + bprintf(bp, " fib %u", cmd->arg1); + break; + case O_SOCKARG: + bprintf(bp, " sockarg"); + break; + case O_IN: + bprintf(bp, cmd->len & F_NOT ? " out" : " in"); + break; + case O_DIVERTED: + switch (cmd->arg1) { + case 3: + bprintf(bp, " diverted"); break; - - case O_DENY: - bprintf(bp, "deny"); + case 2: + bprintf(bp, " diverted-output"); break; - - case O_REJECT: - if (cmd->arg1 == ICMP_REJECT_RST) - bprintf(bp, "reset"); - else if (cmd->arg1 == ICMP_REJECT_ABORT) - bprintf(bp, "abort"); - else if (cmd->arg1 == ICMP_UNREACH_HOST) - bprintf(bp, "reject"); - else - print_reject_code(bp, cmd->arg1); + case 1: + bprintf(bp, " diverted-loopback"); break; - - case O_UNREACH6: - if (cmd->arg1 == ICMP6_UNREACH_RST) - bprintf(bp, "reset6"); - else if (cmd->arg1 == ICMP6_UNREACH_ABORT) - bprintf(bp, "abort6"); - else - print_unreach6_code(bp, cmd->arg1); + default: + bprintf(bp, " diverted-?<%u>", cmd->arg1); break; - - case O_SKIPTO: - bprint_uint_arg(bp, "skipto ", cmd->arg1); + } + break; + case O_LAYER2: + bprintf(bp, " layer2"); + break; + case O_XMIT: + case O_RECV: + case O_VIA: + if (cmd->opcode == O_XMIT) + s = "xmit"; + else if (cmd->opcode == O_RECV) + s = "recv"; + else /* if (cmd->opcode == O_VIA) */ + s = "via"; + switch (insntod(cmd, if)->name[0]) { + case '\0': + bprintf(bp, " %s %s", s, + inet_ntoa(insntod(cmd, if)->p.ip)); break; - - case O_PIPE: - bprint_uint_arg(bp, "pipe ", cmd->arg1); + case '\1': + bprintf(bp, " %s table(%s)", s, + table_search_ctlv(fo->tstate, + insntod(cmd, if)->p.kidx)); break; - - case O_QUEUE: - bprint_uint_arg(bp, "queue ", cmd->arg1); - break; - - case O_DIVERT: - bprint_uint_arg(bp, "divert ", cmd->arg1); - break; - - case O_TEE: - bprint_uint_arg(bp, "tee ", cmd->arg1); - break; - - case O_NETGRAPH: - bprint_uint_arg(bp, "netgraph ", cmd->arg1); - break; - - case O_NGTEE: - bprint_uint_arg(bp, "ngtee ", cmd->arg1); - break; - - case O_FORWARD_IP: - { - ipfw_insn_sa *s = (ipfw_insn_sa *)cmd; - - if (s->sa.sin_addr.s_addr == INADDR_ANY) { - bprintf(bp, "fwd tablearg"); - } else { - bprintf(bp, "fwd %s",inet_ntoa(s->sa.sin_addr)); - } - if (s->sa.sin_port) - bprintf(bp, ",%d", s->sa.sin_port); - } - break; - - case O_FORWARD_IP6: - { - char buf[INET6_ADDRSTRLEN + IF_NAMESIZE + 2]; - ipfw_insn_sa6 *s = (ipfw_insn_sa6 *)cmd; - - bprintf(bp, "fwd "); - if (getnameinfo((const struct sockaddr *)&s->sa, - sizeof(struct sockaddr_in6), buf, sizeof(buf), - NULL, 0, NI_NUMERICHOST) == 0) - bprintf(bp, "%s", buf); - if (s->sa.sin6_port) - bprintf(bp, ",%d", s->sa.sin6_port); - } - break; - - case O_LOG: /* O_LOG is printed last */ - logptr = (ipfw_insn_log *)cmd; - break; - - case O_ALTQ: /* O_ALTQ is printed after O_LOG */ - altqptr = (ipfw_insn_altq *)cmd; - break; - - case O_TAG: - tagptr = cmd; - break; - - case O_NAT: - if (cmd->arg1 != IP_FW_NAT44_GLOBAL) - bprint_uint_arg(bp, "nat ", cmd->arg1); - else - bprintf(bp, "nat global"); - break; - - case O_SETFIB: - if (cmd->arg1 == IP_FW_TARG) - bprint_uint_arg(bp, "setfib ", cmd->arg1); - else - bprintf(bp, "setfib %u", cmd->arg1 & 0x7FFF); - break; - - case O_EXTERNAL_ACTION: { - /* - * The external action can consists of two following - * each other opcodes - O_EXTERNAL_ACTION and - * O_EXTERNAL_INSTANCE. The first contains the ID of - * name of external action. The second contains the ID - * of name of external action instance. - * NOTE: in case when external action has no named - * instances support, the second opcode isn't needed. - */ - has_eaction = cmd; - ename = object_search_ctlv(fo->tstate, cmd->arg1, - IPFW_TLV_EACTION); - if (match_token(rule_eactions, ename) != -1) - bprintf(bp, "%s", ename); - else - bprintf(bp, "eaction %s", ename); - break; + default: + bprintf(bp, " %s %s", s, + insntod(cmd, if)->name); } - - case O_EXTERNAL_INSTANCE: { - if (has_eaction == NULL) + break; + case O_IP_FLOW_LOOKUP: + s = table_search_ctlv(fo->tstate, cmd->arg1); + bprintf(bp, " flow table(%s", s); + if (F_LEN(cmd) == F_INSN_SIZE(ipfw_insn_u32)) + bprintf(bp, ",%u", insntod(cmd, u32)->d[0]); + bprintf(bp, ")"); + break; + case O_IPID: + case O_IPTTL: + case O_IPLEN: + case O_TCPDATALEN: + case O_TCPWIN: + if (F_LEN(cmd) == 1) { + switch (cmd->opcode) { + case O_IPID: + s = "ipid"; break; - /* - * XXX: we need to teach ipfw(9) to rewrite opcodes - * in the user buffer on rule addition. When we add - * the rule, we specify zero TLV type for - * O_EXTERNAL_INSTANCE object. To show correct - * rule after `ipfw add` we need to search instance - * name with zero type. But when we do `ipfw show` - * we calculate TLV type using IPFW_TLV_EACTION_NAME() - * macro. - */ - ename = object_search_ctlv(fo->tstate, cmd->arg1, 0); - if (ename == NULL) - ename = object_search_ctlv(fo->tstate, - cmd->arg1, - IPFW_TLV_EACTION_NAME(has_eaction->arg1)); - bprintf(bp, " %s", ename); - break; - } - - case O_EXTERNAL_DATA: { - if (has_eaction == NULL) + case O_IPTTL: + s = "ipttl"; break; - /* - * Currently we support data formatting only for - * external data with datalen u16. For unknown data - * print its size in bytes. - */ - if (cmd->len == F_INSN_SIZE(ipfw_insn)) - bprintf(bp, " %u", cmd->arg1); - else - bprintf(bp, " %ubytes", - cmd->len * sizeof(uint32_t)); - break; - } - - case O_SETDSCP: - { - const char *code; - - if (cmd->arg1 == IP_FW_TARG) { - bprint_uint_arg(bp, "setdscp ", cmd->arg1); + case O_IPLEN: + s = "iplen"; break; + case O_TCPDATALEN: + s = "tcpdatalen"; + break; + case O_TCPWIN: + s = "tcpwin"; + break; } - uval = cmd->arg1 & 0x3F; - if ((code = match_value(f_ipdscp, uval)) != NULL) - bprintf(bp, "setdscp %s", code); - else - bprint_uint_arg(bp, "setdscp ", uval); - } - break; + bprintf(bp, " %s %u", s, cmd->arg1); + } else + print_newports(bp, insntod(cmd, u16), 0, + cmd->opcode); + break; + case O_IPVER: + bprintf(bp, " ipver %u", cmd->arg1); + break; + case O_IPPRECEDENCE: + bprintf(bp, " ipprecedence %u", cmd->arg1 >> 5); + break; + case O_DSCP: + print_dscp(bp, insntod(cmd, u32)); + break; + case O_IPOPT: + print_flags(bp, "ipoptions", cmd, f_ipopts); + break; + case O_IPTOS: + print_flags(bp, "iptos", cmd, f_iptos); + break; + case O_ICMPTYPE: + print_icmptypes(bp, insntod(cmd, u32)); + break; + case O_ESTAB: + bprintf(bp, " established"); + break; + case O_TCPFLAGS: + print_flags(bp, "tcpflags", cmd, f_tcpflags); + break; + case O_TCPOPTS: + print_flags(bp, "tcpoptions", cmd, f_tcpopts); + break; + case O_TCPACK: + bprintf(bp, " tcpack %d", + ntohl(insntod(cmd, u32)->d[0])); + break; + case O_TCPSEQ: + bprintf(bp, " tcpseq %d", + ntohl(insntod(cmd, u32)->d[0])); + break; + case O_UID: + pwd = getpwuid(insntod(cmd, u32)->d[0]); + if (pwd != NULL) + bprintf(bp, " uid %s", pwd->pw_name); + else + bprintf(bp, " uid %u", + insntod(cmd, u32)->d[0]); + break; + case O_GID: + grp = getgrgid(insntod(cmd, u32)->d[0]); + if (grp != NULL) + bprintf(bp, " gid %s", grp->gr_name); + else + bprintf(bp, " gid %u", + insntod(cmd, u32)->d[0]); + break; + case O_JAIL: + bprintf(bp, " jail %d", insntod(cmd, u32)->d[0]); + break; + case O_VERREVPATH: + bprintf(bp, " verrevpath"); + break; + case O_VERSRCREACH: + bprintf(bp, " versrcreach"); + break; + case O_ANTISPOOF: + bprintf(bp, " antispoof"); + break; + case O_IPSEC: + bprintf(bp, " ipsec"); + break; + case O_NOP: + bprintf(bp, " // %s", (char *)(cmd + 1)); + break; + case O_KEEP_STATE: + bprintf(bp, " keep-state"); + bprintf(bp, " :%s", + object_search_ctlv(fo->tstate, cmd->arg1, + IPFW_TLV_STATE_NAME)); + break; + case O_LIMIT: + print_limit(bp, insntod(cmd, limit)); + bprintf(bp, " :%s", + object_search_ctlv(fo->tstate, cmd->arg1, + IPFW_TLV_STATE_NAME)); + break; + case O_IP6: + bprintf(bp, " ip6"); + break; + case O_IP4: + bprintf(bp, " ip4"); + break; + case O_ICMP6TYPE: + print_icmp6types(bp, insntod(cmd, u32)); + break; + case O_EXT_HDR: + print_ext6hdr(bp, cmd); + break; + case O_TAGGED: + if (F_LEN(cmd) == 1) + bprint_uint_arg(bp, " tagged ", cmd->arg1); + else + print_newports(bp, insntod(cmd, u16), + 0, O_TAGGED); + break; + default: + bprintf(bp, " [opcode %d len %d]", cmd->opcode, + cmd->len); + } + if (cmd->len & F_OR) { + bprintf(bp, " or"); + state->or_block = 1; + } else if (state->or_block != 0) { + bprintf(bp, " }"); + state->or_block = 0; + } + mark_printed(state, cmd); - case O_REASS: - bprintf(bp, "reass"); - break; + return (1); +} - case O_CALLRETURN: - if (cmd->len & F_NOT) - bprintf(bp, "return"); - else - bprint_uint_arg(bp, "call ", cmd->arg1); - break; +static ipfw_insn * +print_opcode(struct buf_pr *bp, struct format_opts *fo, + struct show_state *state, uint8_t opcode) +{ + ipfw_insn *cmd; + int l; - default: - bprintf(bp, "** unrecognized action %d len %d ", - cmd->opcode, cmd->len); - } + for (l = state->rule->act_ofs, cmd = state->rule->cmd; + l > 0; l -= F_LEN(cmd), cmd += F_LEN(cmd)) { + /* We use zero opcode to print the rest of options */ + if (opcode != 0 && cmd->opcode != opcode) + continue; + /* + * Skip O_NOP, when we printing the rest + * of options, it will be handled separately. + */ + if (cmd->opcode == O_NOP && opcode != O_NOP) + continue; + if (!print_instruction(bp, fo, state, cmd)) + continue; + return (cmd); } - if (logptr) { - if (logptr->max_log > 0) - bprintf(bp, " log logamount %d", logptr->max_log); + return (NULL); +} + +static void +print_fwd(struct buf_pr *bp, const ipfw_insn *cmd) +{ + char buf[INET6_ADDRSTRLEN + IF_NAMESIZE + 2]; + ipfw_insn_sa6 *sa6; + ipfw_insn_sa *sa; + uint16_t port; + + if (cmd->opcode == O_FORWARD_IP) { + sa = insntod(cmd, sa); + port = sa->sa.sin_port; + if (sa->sa.sin_addr.s_addr == INADDR_ANY) + bprintf(bp, "fwd tablearg"); else - bprintf(bp, " log"); + bprintf(bp, "fwd %s", inet_ntoa(sa->sa.sin_addr)); + } else { + sa6 = insntod(cmd, sa6); + port = sa6->sa.sin6_port; + bprintf(bp, "fwd "); + if (getnameinfo((const struct sockaddr *)&sa6->sa, + sizeof(struct sockaddr_in6), buf, sizeof(buf), NULL, 0, + NI_NUMERICHOST) == 0) + bprintf(bp, "%s", buf); } + if (port != 0) + bprintf(bp, ",%u", port); +} + +static int +print_action_instruction(struct buf_pr *bp, const struct format_opts *fo, + struct show_state *state, const ipfw_insn *cmd) +{ + const char *s; + + if (is_printed_opcode(state, cmd)) + return (0); + switch (cmd->opcode) { + case O_CHECK_STATE: + bprintf(bp, "check-state"); + if (cmd->arg1 != 0) + s = object_search_ctlv(fo->tstate, cmd->arg1, + IPFW_TLV_STATE_NAME); + else + s = NULL; + bprintf(bp, " :%s", s ? s: "any"); + break; + case O_ACCEPT: + bprintf(bp, "allow"); + break; + case O_COUNT: + bprintf(bp, "count"); + break; + case O_DENY: + bprintf(bp, "deny"); + break; + case O_REJECT: + if (cmd->arg1 == ICMP_REJECT_RST) + bprintf(bp, "reset"); + else if (cmd->arg1 == ICMP_REJECT_ABORT) + bprintf(bp, "abort"); + else if (cmd->arg1 == ICMP_UNREACH_HOST) + bprintf(bp, "reject"); + else + print_reject_code(bp, cmd->arg1); + break; + case O_UNREACH6: + if (cmd->arg1 == ICMP6_UNREACH_RST) + bprintf(bp, "reset6"); + else if (cmd->arg1 == ICMP6_UNREACH_ABORT) + bprintf(bp, "abort6"); + else + print_unreach6_code(bp, cmd->arg1); + break; + case O_SKIPTO: + bprint_uint_arg(bp, "skipto ", cmd->arg1); + break; + case O_PIPE: + bprint_uint_arg(bp, "pipe ", cmd->arg1); + break; + case O_QUEUE: + bprint_uint_arg(bp, "queue ", cmd->arg1); + break; + case O_DIVERT: + bprint_uint_arg(bp, "divert ", cmd->arg1); + break; + case O_TEE: + bprint_uint_arg(bp, "tee ", cmd->arg1); + break; + case O_NETGRAPH: + bprint_uint_arg(bp, "netgraph ", cmd->arg1); + break; + case O_NGTEE: + bprint_uint_arg(bp, "ngtee ", cmd->arg1); + break; + case O_FORWARD_IP: + case O_FORWARD_IP6: + print_fwd(bp, cmd); + break; + case O_LOG: + if (insntod(cmd, log)->max_log > 0) + bprintf(bp, " log logamount %d", + insntod(cmd, log)->max_log); + else + bprintf(bp, " log"); + break; + case O_ALTQ: #ifndef NO_ALTQ - if (altqptr) { - print_altq_cmd(bp, altqptr); - } + print_altq_cmd(bp, insntod(cmd, altq)); #endif - if (tagptr) { - if (tagptr->len & F_NOT) - bprint_uint_arg(bp, " untag ", tagptr->arg1); + break; + case O_TAG: + bprint_uint_arg(bp, cmd->len & F_NOT ? " untag ": + " tag ", cmd->arg1); + break; + case O_NAT: + if (cmd->arg1 != IP_FW_NAT44_GLOBAL) + bprint_uint_arg(bp, "nat ", cmd->arg1); else - bprint_uint_arg(bp, " tag ", tagptr->arg1); - } - - /* - * then print the body. - */ - for (l = rule->act_ofs, cmd = rule->cmd; - l > 0 ; l -= F_LEN(cmd) , cmd += F_LEN(cmd)) { - if ((cmd->len & F_OR) || (cmd->len & F_NOT)) - continue; - if (cmd->opcode == O_IP4) { - flags |= HAVE_PROTO4; + bprintf(bp, "nat global"); + break; + case O_SETFIB: + if (cmd->arg1 == IP_FW_TARG) + bprint_uint_arg(bp, "setfib ", cmd->arg1); + else + bprintf(bp, "setfib %u", cmd->arg1 & 0x7FFF); + break; + case O_EXTERNAL_ACTION: + /* + * The external action can consists of two following + * each other opcodes - O_EXTERNAL_ACTION and + * O_EXTERNAL_INSTANCE. The first contains the ID of + * name of external action. The second contains the ID + * of name of external action instance. + * NOTE: in case when external action has no named + * instances support, the second opcode isn't needed. + */ + state->eaction = cmd; + s = object_search_ctlv(fo->tstate, cmd->arg1, + IPFW_TLV_EACTION); + if (match_token(rule_eactions, s) != -1) + bprintf(bp, "%s", s); + else + bprintf(bp, "eaction %s", s); + break; + case O_EXTERNAL_INSTANCE: + if (state->eaction == NULL) break; - } else if (cmd->opcode == O_IP6) { - flags |= HAVE_PROTO6; + /* + * XXX: we need to teach ipfw(9) to rewrite opcodes + * in the user buffer on rule addition. When we add + * the rule, we specify zero TLV type for + * O_EXTERNAL_INSTANCE object. To show correct + * rule after `ipfw add` we need to search instance + * name with zero type. But when we do `ipfw show` + * we calculate TLV type using IPFW_TLV_EACTION_NAME() + * macro. + */ + s = object_search_ctlv(fo->tstate, cmd->arg1, 0); + if (s == NULL) + s = object_search_ctlv(fo->tstate, + cmd->arg1, IPFW_TLV_EACTION_NAME( + state->eaction->arg1)); + bprintf(bp, " %s", s); + break; + case O_EXTERNAL_DATA: + if (state->eaction == NULL) break; + /* + * Currently we support data formatting only for + * external data with datalen u16. For unknown data + * print its size in bytes. + */ + if (cmd->len == F_INSN_SIZE(ipfw_insn)) + bprintf(bp, " %u", cmd->arg1); + else + bprintf(bp, " %ubytes", + cmd->len * sizeof(uint32_t)); + break; + case O_SETDSCP: + if (cmd->arg1 == IP_FW_TARG) { + bprintf(bp, "setdscp tablearg"); + break; } + s = match_value(f_ipdscp, cmd->arg1 & 0x3F); + if (s != NULL) + bprintf(bp, "setdscp %s", s); + else + bprintf(bp, "setdscp %s", cmd->arg1 & 0x3F); + break; + case O_REASS: + bprintf(bp, "reass"); + break; + case O_CALLRETURN: + if (cmd->len & F_NOT) + bprintf(bp, "return"); + else + bprint_uint_arg(bp, "call ", cmd->arg1); + break; + default: + bprintf(bp, "** unrecognized action %d len %d ", + cmd->opcode, cmd->len); } - if (rule->flags & IPFW_RULE_NOOPT) { /* empty rules before options */ - if (!co->do_compact) { - show_prerequisites(bp, &flags, HAVE_PROTO, 0); - bprintf(bp, " from any to any"); - } - flags |= HAVE_IP | HAVE_OPTIONS | HAVE_PROTO | - HAVE_SRCIP | HAVE_DSTIP; - } + mark_printed(state, cmd); - if (co->comment_only) - comment = "..."; + return (1); +} - for (l = rule->act_ofs, cmd = rule->cmd; - l > 0 ; l -= F_LEN(cmd) , cmd += F_LEN(cmd)) { - /* useful alias */ - ipfw_insn_u32 *cmd32 = (ipfw_insn_u32 *)cmd; - if (co->comment_only) { - if (cmd->opcode != O_NOP) - continue; - bprintf(bp, " // %s\n", (char *)(cmd + 1)); - return; - } +static ipfw_insn * +print_action(struct buf_pr *bp, struct format_opts *fo, + struct show_state *state, uint8_t opcode) +{ + ipfw_insn *cmd; + int l; - show_prerequisites(bp, &flags, 0, cmd->opcode); + for (l = state->rule->cmd_len - state->rule->act_ofs, + cmd = ACTION_PTR(state->rule); l > 0; + l -= F_LEN(cmd), cmd += F_LEN(cmd)) { + if (cmd->opcode != opcode) + continue; + if (!print_action_instruction(bp, fo, state, cmd)) + continue; + return (cmd); + } + return (NULL); +} - switch(cmd->opcode) { - case O_PROB: - break; /* done already */ +static void +print_proto(struct buf_pr *bp, struct format_opts *fo, + struct show_state *state) +{ + ipfw_insn *cmd; + int l, proto, ip4, ip6, tmp; - case O_PROBE_STATE: - break; /* no need to print anything here */ - - case O_IP_SRC: - case O_IP_SRC_LOOKUP: - case O_IP_SRC_MASK: - case O_IP_SRC_ME: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Wed Apr 11 10:36:22 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC550F8818D; Wed, 11 Apr 2018 10:36:21 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 77E276E164; Wed, 11 Apr 2018 10:36:21 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C4A01B12B; Wed, 11 Apr 2018 10:36:21 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3BAaLBt009732; Wed, 11 Apr 2018 10:36:21 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3BAaKmF009726; Wed, 11 Apr 2018 10:36:20 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201804111036.w3BAaKmF009726@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 11 Apr 2018 10:36:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332401 - in stable/11/sys: conf modules/ipfw netinet netpfil/ipfw X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in stable/11/sys: conf modules/ipfw netinet netpfil/ipfw X-SVN-Commit-Revision: 332401 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 10:36:22 -0000 Author: ae Date: Wed Apr 11 10:36:20 2018 New Revision: 332401 URL: https://svnweb.freebsd.org/changeset/base/332401 Log: MFC r328988,r328989: Rework ipfw dynamic states implementation to be lockless on fast path. o added struct ipfw_dyn_info that keeps all needed for ipfw_chk and for dynamic states implementation information; o added DYN_LOOKUP_NEEDED() macro that can be used to determine the need of new lookup of dynamic states; o ipfw_dyn_rule now becomes obsolete. Currently it used to pass information from kernel to userland only. o IPv4 and IPv6 states now described by different structures dyn_ipv4_state and dyn_ipv6_state; o IPv6 scope zones support is added; o ipfw(4) now depends from Concurrency Kit; o states are linked with "entry" field using CK_SLIST. This allows lockless lookup and protected by mutex modifications. o the "expired" SLIST field is used for states expiring. o struct dyn_data is used to keep generic information for both IPv4 and IPv6; o struct dyn_parent is used to keep O_LIMIT_PARENT information; o IPv4 and IPv6 states are stored in different hash tables; o O_LIMIT_PARENT states now are kept separately from O_LIMIT and O_KEEP_STATE states; o per-cpu dyn_hp pointers are used to implement hazard pointers and they prevent freeing states that are locklessly used by lookup threads; o mutexes to protect modification of lists in hash tables now kept in separate arrays. 65535 limit to maximum number of hash buckets now removed. o Separate lookup and install functions added for IPv4 and IPv6 states and for parent states. o By default now is used Jenkinks hash function. Obtained from: Yandex LLC Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D12685 Modified: stable/11/sys/conf/files stable/11/sys/modules/ipfw/Makefile stable/11/sys/netinet/ip_fw.h stable/11/sys/netpfil/ipfw/ip_fw2.c stable/11/sys/netpfil/ipfw/ip_fw_dynamic.c stable/11/sys/netpfil/ipfw/ip_fw_private.h stable/11/sys/netpfil/ipfw/ip_fw_sockopt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Wed Apr 11 10:24:47 2018 (r332400) +++ stable/11/sys/conf/files Wed Apr 11 10:36:20 2018 (r332401) @@ -4201,7 +4201,8 @@ netpfil/ipfw/ip_dn_io.c optional inet dummynet netpfil/ipfw/ip_dn_glue.c optional inet dummynet netpfil/ipfw/ip_fw2.c optional inet ipfirewall netpfil/ipfw/ip_fw_bpf.c optional inet ipfirewall -netpfil/ipfw/ip_fw_dynamic.c optional inet ipfirewall +netpfil/ipfw/ip_fw_dynamic.c optional inet ipfirewall \ + compile-with "${NORMAL_C} -I$S/contrib/ck/include" netpfil/ipfw/ip_fw_eaction.c optional inet ipfirewall netpfil/ipfw/ip_fw_log.c optional inet ipfirewall netpfil/ipfw/ip_fw_pfil.c optional inet ipfirewall Modified: stable/11/sys/modules/ipfw/Makefile ============================================================================== --- stable/11/sys/modules/ipfw/Makefile Wed Apr 11 10:24:47 2018 (r332400) +++ stable/11/sys/modules/ipfw/Makefile Wed Apr 11 10:36:20 2018 (r332401) @@ -9,7 +9,7 @@ SRCS+= ip_fw_sockopt.c ip_fw_table.c ip_fw_table_algo. SRCS+= ip_fw_table_value.c SRCS+= opt_inet.h opt_inet6.h opt_ipdivert.h opt_ipfw.h -CFLAGS+= -DIPFIREWALL +CFLAGS+= -DIPFIREWALL -I${SRCTOP}/sys/contrib/ck/include # #If you want it verbose #CFLAGS+= -DIPFIREWALL_VERBOSE Modified: stable/11/sys/netinet/ip_fw.h ============================================================================== --- stable/11/sys/netinet/ip_fw.h Wed Apr 11 10:24:47 2018 (r332400) +++ stable/11/sys/netinet/ip_fw.h Wed Apr 11 10:36:20 2018 (r332401) @@ -669,7 +669,7 @@ struct ipfw_flow_id { uint32_t src_ip; uint16_t dst_port; uint16_t src_port; - uint8_t fib; + uint8_t fib; /* XXX: must be uint16_t */ uint8_t proto; uint8_t _flags; /* protocol-specific flags */ uint8_t addr_type; /* 4=ip4, 6=ip6, 1=ether ? */ @@ -680,6 +680,7 @@ struct ipfw_flow_id { }; #endif +#define IS_IP4_FLOW_ID(id) ((id)->addr_type == 4) #define IS_IP6_FLOW_ID(id) ((id)->addr_type == 6) /* Modified: stable/11/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- stable/11/sys/netpfil/ipfw/ip_fw2.c Wed Apr 11 10:24:47 2018 (r332400) +++ stable/11/sys/netpfil/ipfw/ip_fw2.c Wed Apr 11 10:36:20 2018 (r332401) @@ -1385,8 +1385,7 @@ ipfw_chk(struct ip_fw_args *args) * MATCH_NONE when checked and not matched (q = NULL), * MATCH_FORWARD or MATCH_REVERSE otherwise (q != NULL) */ - int dyn_dir = MATCH_UNKNOWN; - uint16_t dyn_name = 0; + struct ipfw_dyn_info dyn_info; struct ip_fw *q = NULL; struct ip_fw_chain *chain = &V_layer3_chain; @@ -1418,6 +1417,7 @@ ipfw_chk(struct ip_fw_args *args) proto = args->f_id.proto = 0; /* mark f_id invalid */ /* XXX 0 is a valid proto: IP/IPv6 Hop-by-Hop Option */ + DYN_INFO_INIT(&dyn_info); /* * PULLUP_TO(len, p, T) makes sure that len + sizeof(T) is contiguous, * then it sets p to point at the offset "len" in the mbuf. WARNING: the @@ -2603,7 +2603,8 @@ do { \ case O_LIMIT: case O_KEEP_STATE: if (ipfw_dyn_install_state(chain, f, - (ipfw_insn_limit *)cmd, args, tablearg)) { + (ipfw_insn_limit *)cmd, args, ulp, + pktlen, &dyn_info, tablearg)) { /* error or limit violation */ retval = IP_FW_DENY; l = 0; /* exit inner loop */ @@ -2617,34 +2618,15 @@ do { \ /* * dynamic rules are checked at the first * keep-state or check-state occurrence, - * with the result being stored in dyn_dir - * and dyn_name. + * with the result being stored in dyn_info. * The compiler introduces a PROBE_STATE * instruction for us when we have a * KEEP_STATE (because PROBE_STATE needs * to be run first). - * - * (dyn_dir == MATCH_UNKNOWN) means this is - * first lookup for such f_id. Do lookup. - * - * (dyn_dir != MATCH_UNKNOWN && - * dyn_name != 0 && dyn_name != cmd->arg1) - * means previous lookup didn't find dynamic - * rule for specific state name and current - * lookup will search rule with another state - * name. Redo lookup. - * - * (dyn_dir != MATCH_UNKNOWN && dyn_name == 0) - * means previous lookup was for `any' name - * and it didn't find rule. No need to do - * lookup again. */ - if ((dyn_dir == MATCH_UNKNOWN || - (dyn_name != 0 && - dyn_name != cmd->arg1)) && - (q = ipfw_dyn_lookup_state(&args->f_id, - ulp, pktlen, &dyn_dir, - (dyn_name = cmd->arg1))) != NULL) { + if (DYN_LOOKUP_NEEDED(&dyn_info, cmd) && + (q = ipfw_dyn_lookup_state(args, ulp, + pktlen, cmd, &dyn_info)) != NULL) { /* * Found dynamic entry, jump to the * 'action' part of the parent rule @@ -2652,13 +2634,7 @@ do { \ * cmdlen. */ f = q; - /* XXX we would like to have f_pos - * readily accessible in the dynamic - * rule, instead of having to - * lookup q->rule. - */ - f_pos = ipfw_find_rule(chain, - f->rulenum, f->id); + f_pos = dyn_info.f_pos; cmd = ACTION_PTR(f); l = f->cmd_len - f->act_ofs; cmdlen = 0; @@ -2875,7 +2851,8 @@ do { \ case O_FORWARD_IP: if (args->eh) /* not valid on layer2 pkts */ break; - if (q != f || dyn_dir == MATCH_FORWARD) { + if (q != f || + dyn_info.direction == MATCH_FORWARD) { struct sockaddr_in *sa; sa = &(((ipfw_insn_sa *)cmd)->sa); @@ -2935,7 +2912,8 @@ do { \ case O_FORWARD_IP6: if (args->eh) /* not valid on layer2 pkts */ break; - if (q != f || dyn_dir == MATCH_FORWARD) { + if (q != f || + dyn_info.direction == MATCH_FORWARD) { struct sockaddr_in6 *sin6; sin6 = &(((ipfw_insn_sa6 *)cmd)->sa); @@ -3089,7 +3067,7 @@ do { \ * @args content, and it may be * used for new state lookup later. */ - dyn_dir = MATCH_UNKNOWN; + DYN_INFO_INIT(&dyn_info); } break; Modified: stable/11/sys/netpfil/ipfw/ip_fw_dynamic.c ============================================================================== --- stable/11/sys/netpfil/ipfw/ip_fw_dynamic.c Wed Apr 11 10:24:47 2018 (r332400) +++ stable/11/sys/netpfil/ipfw/ip_fw_dynamic.c Wed Apr 11 10:36:20 2018 (r332401) @@ -1,4 +1,6 @@ /*- + * Copyright (c) 2017-2018 Yandex LLC + * Copyright (c) 2017-2018 Andrey V. Elsukov * Copyright (c) 2002 Luigi Rizzo, Universita` di Pisa * * Redistribution and use in source and binary forms, with or without @@ -26,32 +28,27 @@ #include __FBSDID("$FreeBSD$"); -#define DEB(x) -#define DDB(x) x - -/* - * Dynamic rule support for ipfw - */ - -#include "opt_ipfw.h" #include "opt_inet.h" +#include "opt_inet6.h" +#include "opt_ipfw.h" #ifndef INET #error IPFIREWALL requires INET. #endif /* INET */ -#include "opt_inet6.h" #include #include -#include +#include #include #include -#include #include +#include +#include #include +#include #include #include #include -#include /* for ETHERTYPE_IP */ +#include #include #include #include @@ -59,7 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include /* ip_defttl */ +#include #include #include #include @@ -68,6 +65,7 @@ __FBSDID("$FreeBSD$"); #ifdef INET6 #include #include +#include #endif #include @@ -77,86 +75,261 @@ __FBSDID("$FreeBSD$"); #ifdef MAC #include #endif +#include /* - * Description of dynamic rules. + * Description of dynamic states. * - * Dynamic rules are stored in lists accessed through a hash table - * (ipfw_dyn_v) whose size is curr_dyn_buckets. This value can - * be modified through the sysctl variable dyn_buckets which is - * updated when the table becomes empty. + * Dynamic states are stored in lists accessed through a hash tables + * whose size is curr_dyn_buckets. This value can be modified through + * the sysctl variable dyn_buckets. * - * XXX currently there is only one list, ipfw_dyn. + * Currently there are four tables: dyn_ipv4, dyn_ipv6, dyn_ipv4_parent, + * and dyn_ipv6_parent. * - * When a packet is received, its address fields are first masked - * with the mask defined for the rule, then hashed, then matched - * against the entries in the corresponding list. - * Dynamic rules can be used for different purposes: + * When a packet is received, its address fields hashed, then matched + * against the entries in the corresponding list by addr_type. + * Dynamic states can be used for different purposes: * + stateful rules; * + enforcing limits on the number of sessions; * + in-kernel NAT (not implemented yet) * - * The lifetime of dynamic rules is regulated by dyn_*_lifetime, + * The lifetime of dynamic states is regulated by dyn_*_lifetime, * measured in seconds and depending on the flags. * - * The total number of dynamic rules is equal to UMA zone items count. - * The max number of dynamic rules is dyn_max. When we reach + * The total number of dynamic states is equal to UMA zone items count. + * The max number of dynamic states is dyn_max. When we reach * the maximum number of rules we do not create anymore. This is * done to avoid consuming too much memory, but also too much * time when searching on each packet (ideally, we should try instead * to put a limit on the length of the list on each bucket...). * - * Each dynamic rule holds a pointer to the parent ipfw rule so - * we know what action to perform. Dynamic rules are removed when - * the parent rule is deleted. This can be changed by dyn_keep_states - * sysctl. + * Each state holds a pointer to the parent ipfw rule so we know what + * action to perform. Dynamic rules are removed when the parent rule is + * deleted. * * There are some limitations with dynamic rules -- we do not * obey the 'randomized match', and we do not do multiple * passes through the firewall. XXX check the latter!!! */ -struct ipfw_dyn_bucket { - struct mtx mtx; /* Bucket protecting lock */ - ipfw_dyn_rule *head; /* Pointer to first rule */ +/* By default use jenkins hash function */ +#define IPFIREWALL_JENKINSHASH + +#define DYN_COUNTER_INC(d, dir, pktlen) do { \ + (d)->pcnt_ ## dir++; \ + (d)->bcnt_ ## dir += pktlen; \ + } while (0) + +struct dyn_data { + void *parent; /* pointer to parent rule */ + uint32_t chain_id; /* cached ruleset id */ + uint32_t f_pos; /* cached rule index */ + + uint32_t hashval; /* hash value used for hash resize */ + uint16_t fibnum; /* fib used to send keepalives */ + uint8_t _pad[3]; + uint8_t set; /* parent rule set number */ + uint16_t rulenum; /* parent rule number */ + uint32_t ruleid; /* parent rule id */ + + uint32_t state; /* TCP session state and flags */ + uint32_t ack_fwd; /* most recent ACKs in forward */ + uint32_t ack_rev; /* and reverse direction (used */ + /* to generate keepalives) */ + uint32_t sync; /* synchronization time */ + uint32_t expire; /* expire time */ + + uint64_t pcnt_fwd; /* bytes counter in forward */ + uint64_t bcnt_fwd; /* packets counter in forward */ + uint64_t pcnt_rev; /* bytes counter in reverse */ + uint64_t bcnt_rev; /* packets counter in reverse */ }; +#define DPARENT_COUNT_DEC(p) do { \ + MPASS(p->count > 0); \ + ck_pr_dec_32(&(p)->count); \ +} while (0) +#define DPARENT_COUNT_INC(p) ck_pr_inc_32(&(p)->count) +#define DPARENT_COUNT(p) ck_pr_load_32(&(p)->count) +struct dyn_parent { + void *parent; /* pointer to parent rule */ + uint32_t count; /* number of linked states */ + uint8_t _pad; + uint8_t set; /* parent rule set number */ + uint16_t rulenum; /* parent rule number */ + uint32_t ruleid; /* parent rule id */ + uint32_t hashval; /* hash value used for hash resize */ + uint32_t expire; /* expire time */ +}; + +struct dyn_ipv4_state { + uint8_t type; /* State type */ + uint8_t proto; /* UL Protocol */ + uint16_t kidx; /* named object index */ + uint16_t sport, dport; /* ULP source and destination ports */ + in_addr_t src, dst; /* IPv4 source and destination */ + + union { + struct dyn_data *data; + struct dyn_parent *limit; + }; + CK_SLIST_ENTRY(dyn_ipv4_state) entry; + SLIST_ENTRY(dyn_ipv4_state) expired; +}; +CK_SLIST_HEAD(dyn_ipv4ck_slist, dyn_ipv4_state); +static VNET_DEFINE(struct dyn_ipv4ck_slist *, dyn_ipv4); +static VNET_DEFINE(struct dyn_ipv4ck_slist *, dyn_ipv4_parent); + +SLIST_HEAD(dyn_ipv4_slist, dyn_ipv4_state); +static VNET_DEFINE(struct dyn_ipv4_slist, dyn_expired_ipv4); +#define V_dyn_ipv4 VNET(dyn_ipv4) +#define V_dyn_ipv4_parent VNET(dyn_ipv4_parent) +#define V_dyn_expired_ipv4 VNET(dyn_expired_ipv4) + +#ifdef INET6 +struct dyn_ipv6_state { + uint8_t type; /* State type */ + uint8_t proto; /* UL Protocol */ + uint16_t kidx; /* named object index */ + uint16_t sport, dport; /* ULP source and destination ports */ + struct in6_addr src, dst; /* IPv6 source and destination */ + uint32_t zoneid; /* IPv6 scope zone id */ + union { + struct dyn_data *data; + struct dyn_parent *limit; + }; + CK_SLIST_ENTRY(dyn_ipv6_state) entry; + SLIST_ENTRY(dyn_ipv6_state) expired; +}; +CK_SLIST_HEAD(dyn_ipv6ck_slist, dyn_ipv6_state); +static VNET_DEFINE(struct dyn_ipv6ck_slist *, dyn_ipv6); +static VNET_DEFINE(struct dyn_ipv6ck_slist *, dyn_ipv6_parent); + +SLIST_HEAD(dyn_ipv6_slist, dyn_ipv6_state); +static VNET_DEFINE(struct dyn_ipv6_slist, dyn_expired_ipv6); +#define V_dyn_ipv6 VNET(dyn_ipv6) +#define V_dyn_ipv6_parent VNET(dyn_ipv6_parent) +#define V_dyn_expired_ipv6 VNET(dyn_expired_ipv6) +#endif /* INET6 */ + /* - * Static variables followed by global ones + * Per-CPU pointer indicates that specified state is currently in use + * and must not be reclaimed by expiration callout. */ -static VNET_DEFINE(struct ipfw_dyn_bucket *, ipfw_dyn_v); -static VNET_DEFINE(u_int32_t, dyn_buckets_max); -static VNET_DEFINE(u_int32_t, curr_dyn_buckets); -static VNET_DEFINE(struct callout, ipfw_timeout); -#define V_ipfw_dyn_v VNET(ipfw_dyn_v) -#define V_dyn_buckets_max VNET(dyn_buckets_max) -#define V_curr_dyn_buckets VNET(curr_dyn_buckets) -#define V_ipfw_timeout VNET(ipfw_timeout) +static void **dyn_hp_cache; +static DPCPU_DEFINE(void *, dyn_hp); +#define DYNSTATE_GET(cpu) ck_pr_load_ptr(DPCPU_ID_PTR((cpu), dyn_hp)) +#define DYNSTATE_PROTECT(v) ck_pr_store_ptr(DPCPU_PTR(dyn_hp), (v)) +#define DYNSTATE_RELEASE() DYNSTATE_PROTECT(NULL) +#define DYNSTATE_CRITICAL_ENTER() critical_enter() +#define DYNSTATE_CRITICAL_EXIT() do { \ + DYNSTATE_RELEASE(); \ + critical_exit(); \ +} while (0); -static VNET_DEFINE(uma_zone_t, ipfw_dyn_rule_zone); -#define V_ipfw_dyn_rule_zone VNET(ipfw_dyn_rule_zone) +/* + * We keep two version numbers, one is updated when new entry added to + * the list. Second is updated when an entry deleted from the list. + * Versions are updated under bucket lock. + * + * Bucket "add" version number is used to know, that in the time between + * state lookup (i.e. ipfw_dyn_lookup_state()) and the followed state + * creation (i.e. ipfw_dyn_install_state()) another concurrent thread did + * not install some state in this bucket. Using this info we can avoid + * additional state lookup, because we are sure that we will not install + * the state twice. + * + * Also doing the tracking of bucket "del" version during lookup we can + * be sure, that state entry was not unlinked and freed in time between + * we read the state pointer and protect it with hazard pointer. + * + * An entry unlinked from CK list keeps unchanged until it is freed. + * Unlinked entries are linked into expired lists using "expired" field. + */ -#define IPFW_BUCK_LOCK_INIT(b) \ - mtx_init(&(b)->mtx, "IPFW dynamic bucket", NULL, MTX_DEF) -#define IPFW_BUCK_LOCK_DESTROY(b) \ - mtx_destroy(&(b)->mtx) -#define IPFW_BUCK_LOCK(i) mtx_lock(&V_ipfw_dyn_v[(i)].mtx) -#define IPFW_BUCK_UNLOCK(i) mtx_unlock(&V_ipfw_dyn_v[(i)].mtx) -#define IPFW_BUCK_ASSERT(i) mtx_assert(&V_ipfw_dyn_v[(i)].mtx, MA_OWNED) +/* + * dyn_expire_lock is used to protect access to dyn_expired_xxx lists. + * dyn_bucket_lock is used to get write access to lists in specific bucket. + * Currently one dyn_bucket_lock is used for all ipv4, ipv4_parent, ipv6, + * and ipv6_parent lists. + */ +static VNET_DEFINE(struct mtx, dyn_expire_lock); +static VNET_DEFINE(struct mtx *, dyn_bucket_lock); +#define V_dyn_expire_lock VNET(dyn_expire_lock) +#define V_dyn_bucket_lock VNET(dyn_bucket_lock) +/* + * Bucket's add/delete generation versions. + */ +static VNET_DEFINE(uint32_t *, dyn_ipv4_add); +static VNET_DEFINE(uint32_t *, dyn_ipv4_del); +static VNET_DEFINE(uint32_t *, dyn_ipv4_parent_add); +static VNET_DEFINE(uint32_t *, dyn_ipv4_parent_del); +#define V_dyn_ipv4_add VNET(dyn_ipv4_add) +#define V_dyn_ipv4_del VNET(dyn_ipv4_del) +#define V_dyn_ipv4_parent_add VNET(dyn_ipv4_parent_add) +#define V_dyn_ipv4_parent_del VNET(dyn_ipv4_parent_del) -static VNET_DEFINE(int, dyn_keep_states); -#define V_dyn_keep_states VNET(dyn_keep_states) +#ifdef INET6 +static VNET_DEFINE(uint32_t *, dyn_ipv6_add); +static VNET_DEFINE(uint32_t *, dyn_ipv6_del); +static VNET_DEFINE(uint32_t *, dyn_ipv6_parent_add); +static VNET_DEFINE(uint32_t *, dyn_ipv6_parent_del); +#define V_dyn_ipv6_add VNET(dyn_ipv6_add) +#define V_dyn_ipv6_del VNET(dyn_ipv6_del) +#define V_dyn_ipv6_parent_add VNET(dyn_ipv6_parent_add) +#define V_dyn_ipv6_parent_del VNET(dyn_ipv6_parent_del) +#endif /* INET6 */ +#define DYN_BUCKET(h, b) ((h) & (b - 1)) +#define DYN_BUCKET_VERSION(b, v) ck_pr_load_32(&V_dyn_ ## v[(b)]) +#define DYN_BUCKET_VERSION_BUMP(b, v) ck_pr_inc_32(&V_dyn_ ## v[(b)]) + +#define DYN_BUCKET_LOCK_INIT(lock, b) \ + mtx_init(&lock[(b)], "IPFW dynamic bucket", NULL, MTX_DEF) +#define DYN_BUCKET_LOCK_DESTROY(lock, b) mtx_destroy(&lock[(b)]) +#define DYN_BUCKET_LOCK(b) mtx_lock(&V_dyn_bucket_lock[(b)]) +#define DYN_BUCKET_UNLOCK(b) mtx_unlock(&V_dyn_bucket_lock[(b)]) +#define DYN_BUCKET_ASSERT(b) mtx_assert(&V_dyn_bucket_lock[(b)], MA_OWNED) + +#define DYN_EXPIRED_LOCK_INIT() \ + mtx_init(&V_dyn_expire_lock, "IPFW expired states list", NULL, MTX_DEF) +#define DYN_EXPIRED_LOCK_DESTROY() mtx_destroy(&V_dyn_expire_lock) +#define DYN_EXPIRED_LOCK() mtx_lock(&V_dyn_expire_lock) +#define DYN_EXPIRED_UNLOCK() mtx_unlock(&V_dyn_expire_lock) + +static VNET_DEFINE(uint32_t, dyn_buckets_max); +static VNET_DEFINE(uint32_t, curr_dyn_buckets); +static VNET_DEFINE(struct callout, dyn_timeout); +#define V_dyn_buckets_max VNET(dyn_buckets_max) +#define V_curr_dyn_buckets VNET(curr_dyn_buckets) +#define V_dyn_timeout VNET(dyn_timeout) + +/* Maximum length of states chain in a bucket */ +static VNET_DEFINE(uint32_t, curr_max_length); +#define V_curr_max_length VNET(curr_max_length) + +static VNET_DEFINE(uma_zone_t, dyn_data_zone); +static VNET_DEFINE(uma_zone_t, dyn_parent_zone); +static VNET_DEFINE(uma_zone_t, dyn_ipv4_zone); +#ifdef INET6 +static VNET_DEFINE(uma_zone_t, dyn_ipv6_zone); +#define V_dyn_ipv6_zone VNET(dyn_ipv6_zone) +#endif /* INET6 */ +#define V_dyn_data_zone VNET(dyn_data_zone) +#define V_dyn_parent_zone VNET(dyn_parent_zone) +#define V_dyn_ipv4_zone VNET(dyn_ipv4_zone) + /* * Timeouts for various events in handing dynamic rules. */ -static VNET_DEFINE(u_int32_t, dyn_ack_lifetime); -static VNET_DEFINE(u_int32_t, dyn_syn_lifetime); -static VNET_DEFINE(u_int32_t, dyn_fin_lifetime); -static VNET_DEFINE(u_int32_t, dyn_rst_lifetime); -static VNET_DEFINE(u_int32_t, dyn_udp_lifetime); -static VNET_DEFINE(u_int32_t, dyn_short_lifetime); +static VNET_DEFINE(uint32_t, dyn_ack_lifetime); +static VNET_DEFINE(uint32_t, dyn_syn_lifetime); +static VNET_DEFINE(uint32_t, dyn_fin_lifetime); +static VNET_DEFINE(uint32_t, dyn_rst_lifetime); +static VNET_DEFINE(uint32_t, dyn_udp_lifetime); +static VNET_DEFINE(uint32_t, dyn_short_lifetime); #define V_dyn_ack_lifetime VNET(dyn_ack_lifetime) #define V_dyn_syn_lifetime VNET(dyn_syn_lifetime) @@ -172,10 +345,10 @@ static VNET_DEFINE(u_int32_t, dyn_short_lifetime); * dyn_rst_lifetime and dyn_fin_lifetime should be strictly lower * than dyn_keepalive_period. */ - -static VNET_DEFINE(u_int32_t, dyn_keepalive_interval); -static VNET_DEFINE(u_int32_t, dyn_keepalive_period); -static VNET_DEFINE(u_int32_t, dyn_keepalive); +#define DYN_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); static VNET_DEFINE(time_t, dyn_keepalive_last); #define V_dyn_keepalive_interval VNET(dyn_keepalive_interval) @@ -183,113 +356,208 @@ static VNET_DEFINE(time_t, dyn_keepalive_last); #define V_dyn_keepalive VNET(dyn_keepalive) #define V_dyn_keepalive_last VNET(dyn_keepalive_last) -static VNET_DEFINE(u_int32_t, dyn_max); /* max # of dynamic rules */ - -#define DYN_COUNT uma_zone_get_cur(V_ipfw_dyn_rule_zone) +static VNET_DEFINE(uint32_t, dyn_max); /* max # of dynamic states */ +static VNET_DEFINE(uint32_t, dyn_count); /* number of states */ +static VNET_DEFINE(uint32_t, dyn_parent_max); /* max # of parent states */ +static VNET_DEFINE(uint32_t, dyn_parent_count); /* number of parent states */ #define V_dyn_max VNET(dyn_max) +#define V_dyn_count VNET(dyn_count) +#define V_dyn_parent_max VNET(dyn_parent_max) +#define V_dyn_parent_count VNET(dyn_parent_count) -/* for userspace, we emulate the uma_zone_counter with ipfw_dyn_count */ -static int ipfw_dyn_count; /* number of objects */ +#define DYN_COUNT_DEC(name) do { \ + MPASS((V_ ## name) > 0); \ + ck_pr_dec_32(&(V_ ## name)); \ +} while (0) +#define DYN_COUNT_INC(name) ck_pr_inc_32(&(V_ ## name)) +#define DYN_COUNT(name) ck_pr_load_32(&(V_ ## name)) -#ifdef USERSPACE /* emulation of UMA object counters for userspace */ -#define uma_zone_get_cur(x) ipfw_dyn_count -#endif /* USERSPACE */ +static time_t last_log; /* Log ratelimiting */ -static int last_log; /* Log ratelimiting */ +/* + * Get/set maximum number of dynamic states in given VNET instance. + */ +static int +sysctl_dyn_max(SYSCTL_HANDLER_ARGS) +{ + uint32_t nstates; + int error; -static void ipfw_dyn_tick(void *vnetx); -static void check_dyn_rules(struct ip_fw_chain *, ipfw_range_tlv *, int, int); -#ifdef SYSCTL_NODE + nstates = V_dyn_max; + error = sysctl_handle_32(oidp, &nstates, 0, req); + /* Read operation or some error */ + if ((error != 0) || (req->newptr == NULL)) + return (error); -static int sysctl_ipfw_dyn_count(SYSCTL_HANDLER_ARGS); -static int sysctl_ipfw_dyn_max(SYSCTL_HANDLER_ARGS); + V_dyn_max = nstates; + uma_zone_set_max(V_dyn_data_zone, V_dyn_max); + return (0); +} -SYSBEGIN(f2) +static int +sysctl_dyn_parent_max(SYSCTL_HANDLER_ARGS) +{ + uint32_t nstates; + int error; + nstates = V_dyn_parent_max; + error = sysctl_handle_32(oidp, &nstates, 0, req); + /* Read operation or some error */ + if ((error != 0) || (req->newptr == NULL)) + return (error); + + V_dyn_parent_max = nstates; + uma_zone_set_max(V_dyn_parent_zone, V_dyn_parent_max); + return (0); +} + +static int +sysctl_dyn_buckets(SYSCTL_HANDLER_ARGS) +{ + uint32_t nbuckets; + int error; + + nbuckets = V_dyn_buckets_max; + error = sysctl_handle_32(oidp, &nbuckets, 0, req); + /* Read operation or some error */ + if ((error != 0) || (req->newptr == NULL)) + return (error); + + if (nbuckets > 256) + V_dyn_buckets_max = 1 << fls(nbuckets - 1); + else + return (EINVAL); + return (0); +} + SYSCTL_DECL(_net_inet_ip_fw); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, dyn_buckets, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(dyn_buckets_max), 0, - "Max number of dyn. buckets"); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, curr_dyn_buckets, + +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, dyn_count, + CTLFLAG_VNET | CTLFLAG_RD, &VNET_NAME(dyn_count), 0, + "Current number of dynamic states."); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, dyn_parent_count, + CTLFLAG_VNET | CTLFLAG_RD, &VNET_NAME(dyn_parent_count), 0, + "Current number of parent states. "); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, curr_dyn_buckets, CTLFLAG_VNET | CTLFLAG_RD, &VNET_NAME(curr_dyn_buckets), 0, - "Current Number of dyn. buckets"); -SYSCTL_PROC(_net_inet_ip_fw, OID_AUTO, dyn_count, - CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RD, 0, 0, sysctl_ipfw_dyn_count, "IU", - "Number of dyn. rules"); + "Current number of buckets for states hash table."); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, curr_max_length, + CTLFLAG_VNET | CTLFLAG_RD, &VNET_NAME(curr_max_length), 0, + "Current maximum length of states chains in hash buckets."); +SYSCTL_PROC(_net_inet_ip_fw, OID_AUTO, dyn_buckets, + CTLFLAG_VNET | CTLTYPE_U32 | CTLFLAG_RW, 0, 0, sysctl_dyn_buckets, + "IU", "Max number of buckets for dynamic states hash table."); SYSCTL_PROC(_net_inet_ip_fw, OID_AUTO, dyn_max, - CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, 0, 0, sysctl_ipfw_dyn_max, "IU", - "Max number of dyn. rules"); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, dyn_ack_lifetime, + CTLFLAG_VNET | CTLTYPE_U32 | CTLFLAG_RW, 0, 0, sysctl_dyn_max, + "IU", "Max number of dynamic states."); +SYSCTL_PROC(_net_inet_ip_fw, OID_AUTO, dyn_parent_max, + CTLFLAG_VNET | CTLTYPE_U32 | CTLFLAG_RW, 0, 0, sysctl_dyn_parent_max, + "IU", "Max number of parent dynamic states."); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, dyn_ack_lifetime, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(dyn_ack_lifetime), 0, - "Lifetime of dyn. rules for acks"); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, dyn_syn_lifetime, + "Lifetime of dynamic states for TCP ACK."); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, dyn_syn_lifetime, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(dyn_syn_lifetime), 0, - "Lifetime of dyn. rules for syn"); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, dyn_fin_lifetime, + "Lifetime of dynamic states for TCP SYN."); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, dyn_fin_lifetime, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(dyn_fin_lifetime), 0, - "Lifetime of dyn. rules for fin"); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, dyn_rst_lifetime, + "Lifetime of dynamic states for TCP FIN."); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, dyn_rst_lifetime, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(dyn_rst_lifetime), 0, - "Lifetime of dyn. rules for rst"); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, dyn_udp_lifetime, + "Lifetime of dynamic states for TCP RST."); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, dyn_udp_lifetime, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(dyn_udp_lifetime), 0, - "Lifetime of dyn. rules for UDP"); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, dyn_short_lifetime, + "Lifetime of dynamic states for UDP."); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, dyn_short_lifetime, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(dyn_short_lifetime), 0, - "Lifetime of dyn. rules for other situations"); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, dyn_keepalive, + "Lifetime of dynamic states for other situations."); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, dyn_keepalive, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(dyn_keepalive), 0, - "Enable keepalives for dyn. rules"); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, dyn_keep_states, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(dyn_keep_states), 0, - "Do not flush dynamic states on rule deletion"); + "Enable keepalives for dynamic states."); -SYSEND +#ifdef IPFIREWALL_DYNDEBUG +#define DYN_DEBUG(fmt, ...) do { \ + printf("%s: " fmt "\n", __func__, __VA_ARGS__); \ +} while (0) +#else +#define DYN_DEBUG(fmt, ...) +#endif /* !IPFIREWALL_DYNDEBUG */ -#endif /* SYSCTL_NODE */ - - #ifdef INET6 -static __inline int -hash_packet6(const struct ipfw_flow_id *id) -{ - u_int32_t i; - i = (id->dst_ip6.__u6_addr.__u6_addr32[2]) ^ - (id->dst_ip6.__u6_addr.__u6_addr32[3]) ^ - (id->src_ip6.__u6_addr.__u6_addr32[2]) ^ - (id->src_ip6.__u6_addr.__u6_addr32[3]); - return ntohl(i); -} -#endif +/* Functions to work with IPv6 states */ +static struct dyn_ipv6_state *dyn_lookup_ipv6_state( + const struct ipfw_flow_id *, uint32_t, const void *, + struct ipfw_dyn_info *, int); +static int dyn_lookup_ipv6_state_locked(const struct ipfw_flow_id *, + uint32_t, const void *, int, const void *, uint32_t, uint16_t, uint32_t, + uint16_t); +static struct dyn_ipv6_state *dyn_alloc_ipv6_state( + const struct ipfw_flow_id *, uint32_t, uint16_t, uint8_t); +static int dyn_add_ipv6_state(void *, uint32_t, uint16_t, uint8_t, + const struct ipfw_flow_id *, uint32_t, const void *, int, uint32_t, + struct ipfw_dyn_info *, uint16_t, uint16_t, uint8_t); +static void dyn_export_ipv6_state(const struct dyn_ipv6_state *, + ipfw_dyn_rule *); -/* - * IMPORTANT: the hash function for dynamic rules must be commutative - * in source and destination (ip,port), because rules are bidirectional - * and we want to find both in the same bucket. - */ -static __inline int -hash_packet(const struct ipfw_flow_id *id, int buckets) -{ - u_int32_t i; +static uint32_t dyn_getscopeid(const struct ip_fw_args *); +static void dyn_make_keepalive_ipv6(struct mbuf *, const struct in6_addr *, + const struct in6_addr *, uint32_t, uint32_t, uint32_t, uint16_t, + uint16_t); +static void dyn_enqueue_keepalive_ipv6(struct mbufq *, + const struct dyn_ipv6_state *); +static void dyn_send_keepalive_ipv6(struct ip_fw_chain *); -#ifdef INET6 - if (IS_IP6_FLOW_ID(id)) - i = hash_packet6(id); - else +static struct dyn_ipv6_state *dyn_lookup_ipv6_parent( + const struct ipfw_flow_id *, uint32_t, const void *, uint32_t, uint16_t, + uint32_t); +static struct dyn_ipv6_state *dyn_lookup_ipv6_parent_locked( + const struct ipfw_flow_id *, uint32_t, const void *, uint32_t, uint16_t, + uint32_t); +static struct dyn_ipv6_state *dyn_add_ipv6_parent(void *, uint32_t, uint16_t, + uint8_t, const struct ipfw_flow_id *, uint32_t, uint32_t, uint32_t, + uint16_t); #endif /* INET6 */ - i = (id->dst_ip) ^ (id->src_ip); - i ^= (id->dst_port) ^ (id->src_port); - return (i & (buckets - 1)); -} -#if 0 -#define DYN_DEBUG(fmt, ...) do { \ - printf("%s: " fmt "\n", __func__, __VA_ARGS__); \ -} while (0) -#else -#define DYN_DEBUG(fmt, ...) -#endif +/* Functions to work with limit states */ +static void *dyn_get_parent_state(const struct ipfw_flow_id *, uint32_t, + struct ip_fw *, uint32_t, uint32_t, uint16_t); +static struct dyn_ipv4_state *dyn_lookup_ipv4_parent( + const struct ipfw_flow_id *, const void *, uint32_t, uint16_t, uint32_t); +static struct dyn_ipv4_state *dyn_lookup_ipv4_parent_locked( + const struct ipfw_flow_id *, const void *, uint32_t, uint16_t, uint32_t); +static struct dyn_parent *dyn_alloc_parent(void *, uint32_t, uint16_t, + uint8_t, uint32_t); +static struct dyn_ipv4_state *dyn_add_ipv4_parent(void *, uint32_t, uint16_t, + uint8_t, const struct ipfw_flow_id *, uint32_t, uint32_t, uint16_t); +static void dyn_tick(void *); +static void dyn_expire_states(struct ip_fw_chain *, ipfw_range_tlv *); +static void dyn_free_states(struct ip_fw_chain *); +static void dyn_export_parent(const struct dyn_parent *, uint16_t, + ipfw_dyn_rule *); +static void dyn_export_data(const struct dyn_data *, uint16_t, uint8_t, + ipfw_dyn_rule *); +static uint32_t dyn_update_tcp_state(struct dyn_data *, + const struct ipfw_flow_id *, const struct tcphdr *, int); +static void dyn_update_proto_state(struct dyn_data *, + const struct ipfw_flow_id *, const void *, int, int); + +/* Functions to work with IPv4 states */ +struct dyn_ipv4_state *dyn_lookup_ipv4_state(const struct ipfw_flow_id *, + const void *, struct ipfw_dyn_info *, int); +static int dyn_lookup_ipv4_state_locked(const struct ipfw_flow_id *, + const void *, int, const void *, uint32_t, uint16_t, uint32_t, uint16_t); +static struct dyn_ipv4_state *dyn_alloc_ipv4_state( + const struct ipfw_flow_id *, uint16_t, uint8_t); +static int dyn_add_ipv4_state(void *, uint32_t, uint16_t, uint8_t, + const struct ipfw_flow_id *, const void *, int, uint32_t, + struct ipfw_dyn_info *, uint16_t, uint16_t, uint8_t); +static void dyn_export_ipv4_state(const struct dyn_ipv4_state *, + ipfw_dyn_rule *); + +/* + * Named states support. + */ static char *default_state_name = "default"; struct dyn_state_obj { struct named_object no; @@ -436,7 +704,6 @@ dyn_destroy(struct ip_fw_chain *ch, struct named_objec KASSERT(no->refcnt == 1, ("Destroying object '%s' (type %u, idx %u) with refcnt %u", no->name, no->etlv, no->kidx, no->refcnt)); - DYN_DEBUG("kidx %d", no->kidx); obj = SRV_OBJECT(ch, no->kidx); SRV_OBJECT(ch, no->kidx) = NULL; @@ -472,7 +739,137 @@ static struct opcode_obj_rewrite dyn_opcodes[] = { dyn_create, dyn_destroy }, }; -/** + +/* + * IMPORTANT: the hash function for dynamic rules must be commutative + * in source and destination (ip,port), because rules are bidirectional + * and we want to find both in the same bucket. + */ +#ifndef IPFIREWALL_JENKINSHASH +static __inline uint32_t +hash_packet(const struct ipfw_flow_id *id) +{ + uint32_t i; + +#ifdef INET6 + if (IS_IP6_FLOW_ID(id)) + i = ntohl((id->dst_ip6.__u6_addr.__u6_addr32[2]) ^ + (id->dst_ip6.__u6_addr.__u6_addr32[3]) ^ + (id->src_ip6.__u6_addr.__u6_addr32[2]) ^ + (id->src_ip6.__u6_addr.__u6_addr32[3])); + else +#endif /* INET6 */ + i = (id->dst_ip) ^ (id->src_ip); + i ^= (id->dst_port) ^ (id->src_port); + return (i); +} + +static __inline uint32_t +hash_parent(const struct ipfw_flow_id *id, const void *rule) +{ + + return (hash_packet(id) ^ ((uintptr_t)rule)); +} + +#else /* IPFIREWALL_JENKINSHASH */ + +static VNET_DEFINE(uint32_t, dyn_hashseed); +#define V_dyn_hashseed VNET(dyn_hashseed) + +static __inline int +addrcmp4(const struct ipfw_flow_id *id) +{ + + if (id->src_ip < id->dst_ip) + return (0); + if (id->src_ip > id->dst_ip) + return (1); + if (id->src_port <= id->dst_port) + return (0); + return (1); +} + +#ifdef INET6 +static __inline int +addrcmp6(const struct ipfw_flow_id *id) +{ + int ret; + + ret = memcmp(&id->src_ip6, &id->dst_ip6, sizeof(struct in6_addr)); + if (ret < 0) + return (0); + if (ret > 0) + return (1); + if (id->src_port <= id->dst_port) + return (0); + return (1); +} + +static __inline uint32_t +hash_packet6(const struct ipfw_flow_id *id) +{ + struct tuple6 { + struct in6_addr addr[2]; + uint16_t port[2]; + } t6; + + if (addrcmp6(id) == 0) { + t6.addr[0] = id->src_ip6; + t6.addr[1] = id->dst_ip6; + t6.port[0] = id->src_port; + t6.port[1] = id->dst_port; + } else { + t6.addr[0] = id->dst_ip6; + t6.addr[1] = id->src_ip6; + t6.port[0] = id->dst_port; + t6.port[1] = id->src_port; + } + return (jenkins_hash32((const uint32_t *)&t6, + sizeof(t6) / sizeof(uint32_t), V_dyn_hashseed)); +} +#endif + +static __inline uint32_t +hash_packet(const struct ipfw_flow_id *id) +{ + struct tuple4 { + in_addr_t addr[2]; + uint16_t port[2]; + } t4; + + if (IS_IP4_FLOW_ID(id)) { + /* All fields are in host byte order */ + if (addrcmp4(id) == 0) { + t4.addr[0] = id->src_ip; + t4.addr[1] = id->dst_ip; + t4.port[0] = id->src_port; + t4.port[1] = id->dst_port; + } else { + t4.addr[0] = id->dst_ip; + t4.addr[1] = id->src_ip; + t4.port[0] = id->dst_port; + t4.port[1] = id->src_port; + } + return (jenkins_hash32((const uint32_t *)&t4, + sizeof(t4) / sizeof(uint32_t), V_dyn_hashseed)); + } else +#ifdef INET6 + if (IS_IP6_FLOW_ID(id)) + return (hash_packet6(id)); +#endif + return (0); +} + +static __inline uint32_t +hash_parent(const struct ipfw_flow_id *id, const void *rule) +{ + + return (jenkins_hash32((const uint32_t *)&rule, + sizeof(rule) / sizeof(uint32_t), hash_packet(id))); +} +#endif /* IPFIREWALL_JENKINSHASH */ + +/* * Print customizable flow id description via log(9) facility. */ static void @@ -500,904 +897,1809 @@ print_dyn_rule_flags(const struct ipfw_flow_id *id, in } log(log_flags, "ipfw: %s type %d %s %d -> %s %d, %d %s\n", prefix, dyn_type, src, id->src_port, dst, - id->dst_port, DYN_COUNT, postfix); + id->dst_port, V_dyn_count, postfix); } #define print_dyn_rule(id, dtype, prefix, postfix) \ print_dyn_rule_flags(id, dtype, LOG_DEBUG, prefix, postfix) -#define TIME_LEQ(a,b) ((int)((a)-(b)) <= 0) -#define TIME_LE(a,b) ((int)((a)-(b)) < 0) +#define TIME_LEQ(a,b) ((int)((a)-(b)) <= 0) +#define TIME_LE(a,b) ((int)((a)-(b)) < 0) +#define _SEQ_GE(a,b) ((int)((a)-(b)) >= 0) +#define BOTH_SYN (TH_SYN | (TH_SYN << 8)) +#define BOTH_FIN (TH_FIN | (TH_FIN << 8)) +#define TCP_FLAGS (TH_FLAGS | (TH_FLAGS << 8)) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Wed Apr 11 17:18:40 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D19C2F808E5; Wed, 11 Apr 2018 17:18:40 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7DA3C6A33F; Wed, 11 Apr 2018 17:18:40 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 1F35310AFD4; Wed, 11 Apr 2018 13:18:39 -0400 (EDT) From: John Baldwin To: Slawa Olhovchenkov Cc: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r332091 - stable/11/sys/vm Date: Wed, 11 Apr 2018 08:52:08 -0700 Message-ID: <84716725.OOlTe33nR2@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <20180409162909.GF6612@zxy.spb.ru> References: <201804060925.w369P8c2019558@repo.freebsd.org> <20180409162909.GF6612@zxy.spb.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 11 Apr 2018 13:18:39 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 17:18:41 -0000 On Monday, April 09, 2018 07:29:09 PM Slawa Olhovchenkov wrote: > On Fri, Apr 06, 2018 at 09:25:08AM +0000, Konstantin Belousov wrote: > > > Author: kib > > Date: Fri Apr 6 09:25:08 2018 > > New Revision: 332091 > > URL: https://svnweb.freebsd.org/changeset/base/332091 > > > > Log: > > MFC r331760: > > Make vm_map_max/min/pmap KBI stable. > > > > Modified: > > stable/11/sys/vm/vm_map.c > > stable/11/sys/vm/vm_map.h > > Directory Properties: > > stable/11/ (props changed) > > -STABLE still crashed after load vboxnet build on 11.1-RELEASE > nvidia (build on 11.1-RELEASE) also don't work Yes, this only helps with the future KBI, it doesn't restore the existing one. However, r320889 which was committed earlier should have restored the KBI? -- John Baldwin From owner-svn-src-stable@freebsd.org Wed Apr 11 17:58:46 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70C8CF83F46; Wed, 11 Apr 2018 17:58:46 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 071D174245; Wed, 11 Apr 2018 17:58:46 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1f6K16-0001Wc-PD; Wed, 11 Apr 2018 20:58:44 +0300 Date: Wed, 11 Apr 2018 20:58:44 +0300 From: Slawa Olhovchenkov To: John Baldwin Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov , svn-src-stable-11@freebsd.org Subject: Re: svn commit: r332091 - stable/11/sys/vm Message-ID: <20180411175844.GH6612@zxy.spb.ru> References: <201804060925.w369P8c2019558@repo.freebsd.org> <20180409162909.GF6612@zxy.spb.ru> <84716725.OOlTe33nR2@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <84716725.OOlTe33nR2@ralph.baldwin.cx> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 17:58:46 -0000 On Wed, Apr 11, 2018 at 08:52:08AM -0700, John Baldwin wrote: > On Monday, April 09, 2018 07:29:09 PM Slawa Olhovchenkov wrote: > > On Fri, Apr 06, 2018 at 09:25:08AM +0000, Konstantin Belousov wrote: > > > > > Author: kib > > > Date: Fri Apr 6 09:25:08 2018 > > > New Revision: 332091 > > > URL: https://svnweb.freebsd.org/changeset/base/332091 > > > > > > Log: > > > MFC r331760: > > > Make vm_map_max/min/pmap KBI stable. > > > > > > Modified: > > > stable/11/sys/vm/vm_map.c > > > stable/11/sys/vm/vm_map.h > > > Directory Properties: > > > stable/11/ (props changed) > > > > -STABLE still crashed after load vboxnet build on 11.1-RELEASE > > nvidia (build on 11.1-RELEASE) also don't work > > Yes, this only helps with the future KBI, it doesn't restore the > existing one. However, r320889 which was committed earlier should > have restored the KBI? Sorry, miss you point. I am update to last stable/11, build and install kernel and check old modules. From owner-svn-src-stable@freebsd.org Wed Apr 11 19:49:36 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71BF7F8C435; Wed, 11 Apr 2018 19:49:36 +0000 (UTC) (envelope-from kib@freebsd.org) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C28366F35C; Wed, 11 Apr 2018 19:49:35 +0000 (UTC) (envelope-from kib@freebsd.org) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id w3BJnKRC042403 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 11 Apr 2018 22:49:23 +0300 (EEST) (envelope-from kib@freebsd.org) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w3BJnKRC042403 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w3BJnKO5042402; Wed, 11 Apr 2018 22:49:20 +0300 (EEST) (envelope-from kib@freebsd.org) X-Authentication-Warning: tom.home: kostik set sender to kib@freebsd.org using -f Date: Wed, 11 Apr 2018 22:49:20 +0300 From: Konstantin Belousov To: John Baldwin Cc: Slawa Olhovchenkov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r332091 - stable/11/sys/vm Message-ID: <20180411194920.GM1774@kib.kiev.ua> References: <201804060925.w369P8c2019558@repo.freebsd.org> <20180409162909.GF6612@zxy.spb.ru> <84716725.OOlTe33nR2@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <84716725.OOlTe33nR2@ralph.baldwin.cx> User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 19:49:36 -0000 On Wed, Apr 11, 2018 at 08:52:08AM -0700, John Baldwin wrote: > On Monday, April 09, 2018 07:29:09 PM Slawa Olhovchenkov wrote: > > On Fri, Apr 06, 2018 at 09:25:08AM +0000, Konstantin Belousov wrote: > > > > > Author: kib > > > Date: Fri Apr 6 09:25:08 2018 > > > New Revision: 332091 > > > URL: https://svnweb.freebsd.org/changeset/base/332091 > > > > > > Log: > > > MFC r331760: > > > Make vm_map_max/min/pmap KBI stable. > > > > > > Modified: > > > stable/11/sys/vm/vm_map.c > > > stable/11/sys/vm/vm_map.h > > > Directory Properties: > > > stable/11/ (props changed) > > > > -STABLE still crashed after load vboxnet build on 11.1-RELEASE > > nvidia (build on 11.1-RELEASE) also don't work > > Yes, this only helps with the future KBI, it doesn't restore the > existing one. However, r320889 which was committed earlier should > have restored the KBI? I am not sure. It might have, but there might be more breakage accumulated. My current opinion is that both vbox and nvidia (as well as in-tree and out of tree drm modules) must be marked as tied. The modules definitely depends on much more kernel interfaces than a typical HBA or network controller driver, for which the stability claim is actually intended to apply. From owner-svn-src-stable@freebsd.org Wed Apr 11 21:28:07 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22936F9305B; Wed, 11 Apr 2018 21:28:07 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA7E4857E8; Wed, 11 Apr 2018 21:28:06 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 45D8910A87D; Wed, 11 Apr 2018 17:28:05 -0400 (EDT) From: John Baldwin To: Konstantin Belousov Cc: Slawa Olhovchenkov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r332091 - stable/11/sys/vm Date: Wed, 11 Apr 2018 14:27:48 -0700 Message-ID: <2552898.N5SmTfmv87@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <20180411194920.GM1774@kib.kiev.ua> References: <201804060925.w369P8c2019558@repo.freebsd.org> <84716725.OOlTe33nR2@ralph.baldwin.cx> <20180411194920.GM1774@kib.kiev.ua> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 11 Apr 2018 17:28:05 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 21:28:07 -0000 On Wednesday, April 11, 2018 10:49:20 PM Konstantin Belousov wrote: > On Wed, Apr 11, 2018 at 08:52:08AM -0700, John Baldwin wrote: > > On Monday, April 09, 2018 07:29:09 PM Slawa Olhovchenkov wrote: > > > On Fri, Apr 06, 2018 at 09:25:08AM +0000, Konstantin Belousov wrote: > > > > > > > Author: kib > > > > Date: Fri Apr 6 09:25:08 2018 > > > > New Revision: 332091 > > > > URL: https://svnweb.freebsd.org/changeset/base/332091 > > > > > > > > Log: > > > > MFC r331760: > > > > Make vm_map_max/min/pmap KBI stable. > > > > > > > > Modified: > > > > stable/11/sys/vm/vm_map.c > > > > stable/11/sys/vm/vm_map.h > > > > Directory Properties: > > > > stable/11/ (props changed) > > > > > > -STABLE still crashed after load vboxnet build on 11.1-RELEASE > > > nvidia (build on 11.1-RELEASE) also don't work > > > > Yes, this only helps with the future KBI, it doesn't restore the > > existing one. However, r320889 which was committed earlier should > > have restored the KBI? > > I am not sure. It might have, but there might be more breakage > accumulated. My current opinion is that both vbox and nvidia (as well as > in-tree and out of tree drm modules) must be marked as tied. The modules > definitely depends on much more kernel interfaces than a typical HBA or > network controller driver, for which the stability claim is actually > intended to apply. I do think virtualbox is probably too hard to make work, but I didn't think the nvidia driver was that bad. I think that for kmods in ports we should consider moving to a different model than we currently do where the port installs the source for the kernel module to a standard location and we could have a way to rebuild all of the modules as needed. This would permit us to provide PORTS_MODULES-type functionality via either ports or packages (and it is a bit more flexible as you wouldn't to deinstall/reinstall the package each time you just wanted to rebuild the kernel module). I would suggest something like /usr/local/src/modules/ and a 'LOCAL_MODULES' kernel option that is a list of ' ' to replace PORTS_MODULES. A package could still ship an initial module by default, but recompiling the module would either overwrite it, or if the module is built as part of the kernel (via LOCAL_MODULES) the new one would be installed with the kernel itself into /boot/kernel leaving the one from the package in /boot/modules. For tied modules we could simply build it with a strict MODULE_DEPEND line on the kernel so that the pre-built module won't load on newer kernels and then encourage the user to use LOCAL_MODULES in pkg-message. Using LOCAL_MODULES would be better than PORTS_MODULES as it would DTRT if you move kernel to kernel.old during an upgrade, etc. -- John Baldwin From owner-svn-src-stable@freebsd.org Wed Apr 11 21:49:39 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E5A8F94591; Wed, 11 Apr 2018 21:49:39 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E286699AF; Wed, 11 Apr 2018 21:49:39 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1f6NcV-0003yu-Vt; Thu, 12 Apr 2018 00:49:35 +0300 Date: Thu, 12 Apr 2018 00:49:35 +0300 From: Slawa Olhovchenkov To: John Baldwin Cc: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r332091 - stable/11/sys/vm Message-ID: <20180411214935.GQ4305@zxy.spb.ru> References: <201804060925.w369P8c2019558@repo.freebsd.org> <84716725.OOlTe33nR2@ralph.baldwin.cx> <20180411194920.GM1774@kib.kiev.ua> <2552898.N5SmTfmv87@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2552898.N5SmTfmv87@ralph.baldwin.cx> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 21:49:39 -0000 On Wed, Apr 11, 2018 at 02:27:48PM -0700, John Baldwin wrote: > On Wednesday, April 11, 2018 10:49:20 PM Konstantin Belousov wrote: > > On Wed, Apr 11, 2018 at 08:52:08AM -0700, John Baldwin wrote: > > > On Monday, April 09, 2018 07:29:09 PM Slawa Olhovchenkov wrote: > > > > On Fri, Apr 06, 2018 at 09:25:08AM +0000, Konstantin Belousov wrote: > > > > > > > > > Author: kib > > > > > Date: Fri Apr 6 09:25:08 2018 > > > > > New Revision: 332091 > > > > > URL: https://svnweb.freebsd.org/changeset/base/332091 > > > > > > > > > > Log: > > > > > MFC r331760: > > > > > Make vm_map_max/min/pmap KBI stable. > > > > > > > > > > Modified: > > > > > stable/11/sys/vm/vm_map.c > > > > > stable/11/sys/vm/vm_map.h > > > > > Directory Properties: > > > > > stable/11/ (props changed) > > > > > > > > -STABLE still crashed after load vboxnet build on 11.1-RELEASE > > > > nvidia (build on 11.1-RELEASE) also don't work > > > > > > Yes, this only helps with the future KBI, it doesn't restore the > > > existing one. However, r320889 which was committed earlier should > > > have restored the KBI? > > > > I am not sure. It might have, but there might be more breakage > > accumulated. My current opinion is that both vbox and nvidia (as well as > > in-tree and out of tree drm modules) must be marked as tied. The modules > > definitely depends on much more kernel interfaces than a typical HBA or > > network controller driver, for which the stability claim is actually > > intended to apply. > > I do think virtualbox is probably too hard to make work, but I didn't think > the nvidia driver was that bad. > > I think that for kmods in ports we should consider moving to a different model > than we currently do where the port installs the source for the kernel > module to a standard location and we could have a way to rebuild all of the > modules as needed. This would permit us to provide PORTS_MODULES-type > functionality via either ports or packages (and it is a bit more flexible as > you wouldn't to deinstall/reinstall the package each time you just wanted to > rebuild the kernel module). > > I would suggest something like /usr/local/src/modules/ and a > 'LOCAL_MODULES' kernel option that is a list of ' ' to replace > PORTS_MODULES. A package could still ship an initial module by default, but > recompiling the module would either overwrite it, or if the module is built as > part of the kernel (via LOCAL_MODULES) the new one would be installed with the > kernel itself into /boot/kernel leaving the one from the package in > /boot/modules. For tied modules we could simply build it with a strict > MODULE_DEPEND line on the kernel so that the pre-built module won't load on > newer kernels and then encourage the user to use LOCAL_MODULES in pkg-message. > Using LOCAL_MODULES would be better than PORTS_MODULES as it would DTRT if you > move kernel to kernel.old during an upgrade, etc. Hmm, what about packages? I am use nvidia driver as package. From owner-svn-src-stable@freebsd.org Wed Apr 11 22:23:23 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62278F96975; Wed, 11 Apr 2018 22:23:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 162AE710B8; Wed, 11 Apr 2018 22:23:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1122B22327; Wed, 11 Apr 2018 22:23:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3BMNMn4068851; Wed, 11 Apr 2018 22:23:22 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3BMNMmV068849; Wed, 11 Apr 2018 22:23:22 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201804112223.w3BMNMmV068849@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 11 Apr 2018 22:23:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332420 - in stable/11: stand/common sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable/11: stand/common sys/kern X-SVN-Commit-Revision: 332420 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 22:23:23 -0000 Author: jhb Date: Wed Apr 11 22:23:22 2018 New Revision: 332420 URL: https://svnweb.freebsd.org/changeset/base/332420 Log: MFC 328101,328911: Require SHF_ALLOC for kernel object module sections. 328101: Require the SHF_ALLOC flag for program sections from kernel object modules. ELF object files can contain program sections which are not supposed to be loaded into memory (e.g. .comment). Normally the static linker uses these flags to decide which sections are allocated to loadable program segments in ELF binaries and shared objects (including kernels on all architectures and kernel modules on architectures other than amd64). Mapping ELF object files (such as amd64 kernel modules) into memory directly is a bit of a grey area. ELF object files are intended to be used as inputs to the static linker. As a result, there is not a standardized definition for what the memory layout of an ELF object should be (none of the section headers have valid virtual memory addresses for example). The kernel and loader were not checking the SHF_ALLOC flag but loading any program sections with certain types such as SHT_PROGBITS. As a result, the kernel and loader would load into RAM some sections that weren't marked with SHF_ALLOC such as .comment that are not loaded into RAM for kernel modules on other architectures (which are implemented as ELF shared objects). Aside from possibly requiring slightly more RAM to hold a kernel module this does not affect runtime correctness as the kernel relocates symbols based on the layout it uses. Debuggers such as gdb and lldb do not extract symbol tables from a running process or kernel. Instead, they replicate the memory layout of ELF executables and shared objects and use that to construct their own symbol tables. For executables and shared objects this works fine. For ELF objects the current logic in kgdb (and probably lldb based on a simple reading) assumes that only sections with SHF_ALLOC are memory resident when constructing a memory layout. If the debugger constructs a different memory layout than the kernel, then it will compute different addresses for symbols causing symbols in the debugger to appear to have the wrong values (though the kernel itself is working fine). The current port of mdb does not check SHF_ALLOC as it replicates the kernel's logic in its existing kernel support. The bfd linker sorts the sections in ELF object files such that all of the allocated sections (sections with SHF_ALLOCATED) are placed first followed by unallocated sections. As a result, when kgdb composed a memory layout using only the allocated sections, this layout happened to match the layout used by the kernel and loader. The lld linker does not sort the sections in ELF object files and mixed allocated and unallocated sections. This resulted in kgdb composing a different memory layout than the kernel and loader. We could either patch kgdb (and possibly in the future lldb) to use custom handling when generating memory layouts for kernel modules that are ELF objects, or we could change the kernel and loader to check SHF_ALLOCATED. I chose the latter as I feel we shouldn't be loading things into RAM that the module won't use. This should mostly be a NOP when linking with bfd but will allow the existing kgdb to work with amd64 kernel modules linked with lld. Note that we only require SHF_ALLOC for "program" sections for types like SHT_PROGBITS and SHT_NOBITS. Other section types such as symbol tables, string tables, and relocations must also be loaded and are not marked with SHF_ALLOC. 328911: Ignore relocation tables for non-memory-resident sections. As a followup to r328101, ignore relocation tables for ELF object sections that are not memory resident. For modules loaded by the loader, ignore relocation tables whose associated section was not loaded by the loader (sh_addr is zero). For modules loaded at runtime via kldload(2), ignore relocation tables whose associated section is not marked with SHF_ALLOC. Modified: stable/11/stand/common/load_elf_obj.c stable/11/sys/kern/link_elf_obj.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/common/load_elf_obj.c ============================================================================== --- stable/11/stand/common/load_elf_obj.c Wed Apr 11 21:41:59 2018 (r332419) +++ stable/11/stand/common/load_elf_obj.c Wed Apr 11 22:23:22 2018 (r332420) @@ -224,6 +224,8 @@ __elfN(obj_loadimage)(struct preloaded_file *fp, elf_f #if defined(__i386__) || defined(__amd64__) case SHT_X86_64_UNWIND: #endif + if ((shdr[i].sh_flags & SHF_ALLOC) == 0) + break; lastaddr = roundup(lastaddr, shdr[i].sh_addralign); shdr[i].sh_addr = (Elf_Addr)lastaddr; lastaddr += shdr[i].sh_size; @@ -280,6 +282,8 @@ __elfN(obj_loadimage)(struct preloaded_file *fp, elf_f switch (shdr[i].sh_type) { case SHT_REL: case SHT_RELA: + if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0) + break; lastaddr = roundup(lastaddr, shdr[i].sh_addralign); shdr[i].sh_addr = (Elf_Addr)lastaddr; lastaddr += shdr[i].sh_size; Modified: stable/11/sys/kern/link_elf_obj.c ============================================================================== --- stable/11/sys/kern/link_elf_obj.c Wed Apr 11 21:41:59 2018 (r332419) +++ stable/11/sys/kern/link_elf_obj.c Wed Apr 11 22:23:22 2018 (r332420) @@ -260,6 +260,9 @@ link_elf_link_preload(linker_class_t cls, const char * #ifdef __amd64__ case SHT_X86_64_UNWIND: #endif + /* Ignore sections not loaded by the loader. */ + if (shdr[i].sh_addr == 0) + break; ef->nprogtab++; break; case SHT_SYMTAB: @@ -267,9 +270,17 @@ link_elf_link_preload(linker_class_t cls, const char * symstrindex = shdr[i].sh_link; break; case SHT_REL: + /* + * Ignore relocation tables for sections not + * loaded by the loader. + */ + if (shdr[shdr[i].sh_info].sh_addr == 0) + break; ef->nreltab++; break; case SHT_RELA: + if (shdr[shdr[i].sh_info].sh_addr == 0) + break; ef->nrelatab++; break; } @@ -333,6 +344,8 @@ link_elf_link_preload(linker_class_t cls, const char * #ifdef __amd64__ case SHT_X86_64_UNWIND: #endif + if (shdr[i].sh_addr == 0) + break; ef->progtab[pb].addr = (void *)shdr[i].sh_addr; if (shdr[i].sh_type == SHT_PROGBITS) ef->progtab[pb].name = "<>"; @@ -391,12 +404,16 @@ link_elf_link_preload(linker_class_t cls, const char * pb++; break; case SHT_REL: + if (shdr[shdr[i].sh_info].sh_addr == 0) + break; ef->reltab[rl].rel = (Elf_Rel *)shdr[i].sh_addr; ef->reltab[rl].nrel = shdr[i].sh_size / sizeof(Elf_Rel); ef->reltab[rl].sec = shdr[i].sh_info; rl++; break; case SHT_RELA: + if (shdr[shdr[i].sh_info].sh_addr == 0) + break; ef->relatab[ra].rela = (Elf_Rela *)shdr[i].sh_addr; ef->relatab[ra].nrela = shdr[i].sh_size / sizeof(Elf_Rela); @@ -599,6 +616,8 @@ link_elf_load_file(linker_class_t cls, const char *fil #ifdef __amd64__ case SHT_X86_64_UNWIND: #endif + if ((shdr[i].sh_flags & SHF_ALLOC) == 0) + break; ef->nprogtab++; break; case SHT_SYMTAB: @@ -607,9 +626,17 @@ link_elf_load_file(linker_class_t cls, const char *fil symstrindex = shdr[i].sh_link; break; case SHT_REL: + /* + * Ignore relocation tables for unallocated + * sections. + */ + if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0) + break; ef->nreltab++; break; case SHT_RELA: + if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0) + break; ef->nrelatab++; break; case SHT_STRTAB: @@ -714,6 +741,8 @@ link_elf_load_file(linker_class_t cls, const char *fil #ifdef __amd64__ case SHT_X86_64_UNWIND: #endif + if ((shdr[i].sh_flags & SHF_ALLOC) == 0) + break; alignmask = shdr[i].sh_addralign - 1; mapsize += alignmask; mapsize &= ~alignmask; @@ -784,6 +813,8 @@ link_elf_load_file(linker_class_t cls, const char *fil #ifdef __amd64__ case SHT_X86_64_UNWIND: #endif + if ((shdr[i].sh_flags & SHF_ALLOC) == 0) + break; alignmask = shdr[i].sh_addralign - 1; mapbase += alignmask; mapbase &= ~alignmask; @@ -863,6 +894,8 @@ link_elf_load_file(linker_class_t cls, const char *fil pb++; break; case SHT_REL: + if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0) + break; ef->reltab[rl].rel = malloc(shdr[i].sh_size, M_LINKER, M_WAITOK); ef->reltab[rl].nrel = shdr[i].sh_size / sizeof(Elf_Rel); @@ -881,6 +914,8 @@ link_elf_load_file(linker_class_t cls, const char *fil rl++; break; case SHT_RELA: + if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0) + break; ef->relatab[ra].rela = malloc(shdr[i].sh_size, M_LINKER, M_WAITOK); ef->relatab[ra].nrela = From owner-svn-src-stable@freebsd.org Thu Apr 12 13:39:02 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B853F960FE; Thu, 12 Apr 2018 13:39:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BD03368BBA; Thu, 12 Apr 2018 13:39:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B67BC4041; Thu, 12 Apr 2018 13:39:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3CDd1El024273; Thu, 12 Apr 2018 13:39:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3CDd1r9024272; Thu, 12 Apr 2018 13:39:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804121339.w3CDd1r9024272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 12 Apr 2018 13:39:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332427 - stable/11/sys/amd64/amd64 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/amd64/amd64 X-SVN-Commit-Revision: 332427 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 13:39:02 -0000 Author: kib Date: Thu Apr 12 13:39:01 2018 New Revision: 332427 URL: https://svnweb.freebsd.org/changeset/base/332427 Log: MFC r332060: Make the INTO instruction operational in 32bit mode. Modified: stable/11/sys/amd64/amd64/machdep.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/machdep.c ============================================================================== --- stable/11/sys/amd64/amd64/machdep.c Thu Apr 12 10:37:26 2018 (r332426) +++ stable/11/sys/amd64/amd64/machdep.c Thu Apr 12 13:39:01 2018 (r332427) @@ -1644,7 +1644,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) setidt(IDT_BP, pti ? &IDTVEC(bpt_pti) : &IDTVEC(bpt), SDT_SYSIGT, SEL_UPL, 0); setidt(IDT_OF, pti ? &IDTVEC(ofl_pti) : &IDTVEC(ofl), SDT_SYSIGT, - SEL_KPL, 0); + SEL_UPL, 0); setidt(IDT_BR, pti ? &IDTVEC(bnd_pti) : &IDTVEC(bnd), SDT_SYSIGT, SEL_KPL, 0); setidt(IDT_UD, pti ? &IDTVEC(ill_pti) : &IDTVEC(ill), SDT_SYSIGT, From owner-svn-src-stable@freebsd.org Thu Apr 12 13:40:03 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84554F96247; Thu, 12 Apr 2018 13:40:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 36FA669375; Thu, 12 Apr 2018 13:40:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 321554047; Thu, 12 Apr 2018 13:40:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3CDe32w024467; Thu, 12 Apr 2018 13:40:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3CDe3IR024466; Thu, 12 Apr 2018 13:40:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804121340.w3CDe3IR024466@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 12 Apr 2018 13:40:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332428 - stable/11/sys/amd64/ia32 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/amd64/ia32 X-SVN-Commit-Revision: 332428 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 13:40:03 -0000 Author: kib Date: Thu Apr 12 13:40:02 2018 New Revision: 332428 URL: https://svnweb.freebsd.org/changeset/base/332428 Log: MFC r332061: Fix ERESTART for lcall $7,$0 syscalls. Modified: stable/11/sys/amd64/ia32/ia32_syscall.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/ia32/ia32_syscall.c ============================================================================== --- stable/11/sys/amd64/ia32/ia32_syscall.c Thu Apr 12 13:39:01 2018 (r332427) +++ stable/11/sys/amd64/ia32/ia32_syscall.c Thu Apr 12 13:40:02 2018 (r332428) @@ -144,6 +144,7 @@ ia32_fetch_syscall_args(struct thread *td) frame->tf_rip = eip; frame->tf_cs = cs; frame->tf_rsp += 2 * sizeof(u_int32_t); + frame->tf_err = 7; /* size of lcall $7,$0 */ } #endif From owner-svn-src-stable@freebsd.org Thu Apr 12 16:44:20 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 433DEFA3132; Thu, 12 Apr 2018 16:44:20 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB99C71289; Thu, 12 Apr 2018 16:44:19 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 394A810AFCD; Thu, 12 Apr 2018 12:44:19 -0400 (EDT) From: John Baldwin To: Slawa Olhovchenkov Cc: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r332091 - stable/11/sys/vm Date: Thu, 12 Apr 2018 09:24:15 -0700 Message-ID: <2836835.6EQUElDheF@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <20180411214935.GQ4305@zxy.spb.ru> References: <201804060925.w369P8c2019558@repo.freebsd.org> <2552898.N5SmTfmv87@ralph.baldwin.cx> <20180411214935.GQ4305@zxy.spb.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Thu, 12 Apr 2018 12:44:19 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 16:44:20 -0000 On Thursday, April 12, 2018 12:49:35 AM Slawa Olhovchenkov wrote: > On Wed, Apr 11, 2018 at 02:27:48PM -0700, John Baldwin wrote: > > > On Wednesday, April 11, 2018 10:49:20 PM Konstantin Belousov wrote: > > > On Wed, Apr 11, 2018 at 08:52:08AM -0700, John Baldwin wrote: > > > > On Monday, April 09, 2018 07:29:09 PM Slawa Olhovchenkov wrote: > > > > > On Fri, Apr 06, 2018 at 09:25:08AM +0000, Konstantin Belousov wrote: > > > > > > > > > > > Author: kib > > > > > > Date: Fri Apr 6 09:25:08 2018 > > > > > > New Revision: 332091 > > > > > > URL: https://svnweb.freebsd.org/changeset/base/332091 > > > > > > > > > > > > Log: > > > > > > MFC r331760: > > > > > > Make vm_map_max/min/pmap KBI stable. > > > > > > > > > > > > Modified: > > > > > > stable/11/sys/vm/vm_map.c > > > > > > stable/11/sys/vm/vm_map.h > > > > > > Directory Properties: > > > > > > stable/11/ (props changed) > > > > > > > > > > -STABLE still crashed after load vboxnet build on 11.1-RELEASE > > > > > nvidia (build on 11.1-RELEASE) also don't work > > > > > > > > Yes, this only helps with the future KBI, it doesn't restore the > > > > existing one. However, r320889 which was committed earlier should > > > > have restored the KBI? > > > > > > I am not sure. It might have, but there might be more breakage > > > accumulated. My current opinion is that both vbox and nvidia (as well as > > > in-tree and out of tree drm modules) must be marked as tied. The modules > > > definitely depends on much more kernel interfaces than a typical HBA or > > > network controller driver, for which the stability claim is actually > > > intended to apply. > > > > I do think virtualbox is probably too hard to make work, but I didn't think > > the nvidia driver was that bad. > > > > I think that for kmods in ports we should consider moving to a different model > > than we currently do where the port installs the source for the kernel > > module to a standard location and we could have a way to rebuild all of the > > modules as needed. This would permit us to provide PORTS_MODULES-type > > functionality via either ports or packages (and it is a bit more flexible as > > you wouldn't to deinstall/reinstall the package each time you just wanted to > > rebuild the kernel module). > > > > I would suggest something like /usr/local/src/modules/ and a > > 'LOCAL_MODULES' kernel option that is a list of ' ' to replace > > PORTS_MODULES. A package could still ship an initial module by default, but > > recompiling the module would either overwrite it, or if the module is built as > > part of the kernel (via LOCAL_MODULES) the new one would be installed with the > > kernel itself into /boot/kernel leaving the one from the package in > > /boot/modules. For tied modules we could simply build it with a strict > > MODULE_DEPEND line on the kernel so that the pre-built module won't load on > > newer kernels and then encourage the user to use LOCAL_MODULES in pkg-message. > > Using LOCAL_MODULES would be better than PORTS_MODULES as it would DTRT if you > > move kernel to kernel.old during an upgrade, etc. > > Hmm, what about packages? I am use nvidia driver as package. Yes, in this model, the package would include the necessary sources to rebuild the kernel module as part of the package, installed to /usr/local/src/modules/nvidia-driver or some such. The package could still install a pre-built module to /boot/modules/nvidia-driver.ko, but if you had 'options LOCAL_MODULES="nivida-driver" in your kernel config, then each time you built a kernel it would build an nvidia-driver.ko from /usr/local/src/modules/nvidia-driver that would be installed to /boot/kernel and would thus take precedence over the version in /boot/modules. For kernel modules that really need to be tied to the current kernel we would recommend using LOCAL_MODULES when using custom kernels in the pkg-message. -- John Baldwin From owner-svn-src-stable@freebsd.org Thu Apr 12 19:06:16 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8F9BF87C6B; Thu, 12 Apr 2018 19:06:15 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C01076557; Thu, 12 Apr 2018 19:06:15 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 86DCA75DD; Thu, 12 Apr 2018 19:06:15 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3CJ6Fb8092139; Thu, 12 Apr 2018 19:06:15 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3CJ6FZo092138; Thu, 12 Apr 2018 19:06:15 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201804121906.w3CJ6FZo092138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Thu, 12 Apr 2018 19:06:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332447 - stable/11/sys/dev/ixgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: stable/11/sys/dev/ixgbe X-SVN-Commit-Revision: 332447 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 19:06:16 -0000 Author: shurd Date: Thu Apr 12 19:06:15 2018 New Revision: 332447 URL: https://svnweb.freebsd.org/changeset/base/332447 Log: Work around netmap issue with ixgbe After multiple start/stop of netmap, ixgbe will get into a bad state requiring a reboot to recover. Adding a delay before stopping the interface appears to work around the issue. The -CURRENT driver has diverged too far from -STABLE for an MFC. PR: 221317 Submitted by: Sylvain Galliano Reported by: Cassiano Peixoto Sponsored by: Limelight Networks Modified: stable/11/sys/dev/ixgbe/if_ix.c Modified: stable/11/sys/dev/ixgbe/if_ix.c ============================================================================== --- stable/11/sys/dev/ixgbe/if_ix.c Thu Apr 12 19:00:22 2018 (r332446) +++ stable/11/sys/dev/ixgbe/if_ix.c Thu Apr 12 19:06:15 2018 (r332447) @@ -3567,6 +3567,8 @@ ixgbe_stop(void *arg) mtx_assert(&adapter->core_mtx, MA_OWNED); + msec_delay(1000); + INIT_DEBUGOUT("ixgbe_stop: begin\n"); ixgbe_disable_intr(adapter); callout_stop(&adapter->timer); From owner-svn-src-stable@freebsd.org Thu Apr 12 20:01:23 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9041F8BE49; Thu, 12 Apr 2018 20:01:22 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-yw0-x243.google.com (mail-yw0-x243.google.com [IPv6:2607:f8b0:4002:c05::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 31F4382CBA; Thu, 12 Apr 2018 20:01:22 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-yw0-x243.google.com with SMTP id y64so2557860ywa.3; Thu, 12 Apr 2018 13:01:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=JBGwRErUzD8UGzo3fo25U9FYL9DYfAcdhDA4Z0U6MJI=; b=hjB6UXTs0vleIsKdVPd5XL00ix5YGFSM872J99A/oRS60jc8npVmIaX+jxLaZ0lW1s GTpBAFqrhlrs5dXjGhv27/m1pGDdLxkFIBhr38bt4Qrb6zz/34/eAbGI3Dzg6z0Apyw2 Ah1H2UvQVi8xNoEtlR06qKtUwACfnc/bxwuZUh7fjn8+vhrw5V9RH5fu6E7GOSZh5xDo L6dcEFIOoOgCP2U8WxN73gUPdv+3i11smMi2hytYwiCTfLIF6XvypXklZYUk9sefvFlF /MLFmHjmeSgfJzVPzwUOqiffHBozKIeYi2qXV2NJMlcVVAuWaJyiaM5TWtIAbxYG6BD9 MilA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=JBGwRErUzD8UGzo3fo25U9FYL9DYfAcdhDA4Z0U6MJI=; b=c/MT9OoX/Fo8Wn3iefIgz3mMKB+aotPgAvsKw7SuC/OXXJsbDoXthdVCvEzq7OycR1 NwONVgJ4stEtaWrT28W61NS6Gc5GKppaW6sUvRW6iYvmyihx2FQPoK09PLMTQ6yUokAR +wLA96t7ttTuPbcvg+ES5ooKZUnQoNyU5y0jDpASkvNw8rh+EgP4L3xIdkutdEGIApZc nzWHrvgdV71F9F5Hha36nc+l7wZW9U+M9K16llXqpyiZXxJkNcnCJ9yCNRgFol9UQUOh XJ8k8HyoK84I8r4wv03DtGSmAmvprmA1hpsWisJAHM29jdtFuLLZCqz9BDfEGC9FkY0x t7gg== X-Gm-Message-State: ALQs6tC+U81dQOZcVGeu2lv+8UKwnoi2jMpzdzMXqDAKZJUYdgh4044I rUk8to5vyQACbLbh0qWnxoYZVIUNDMhn2jLhi+o= X-Google-Smtp-Source: AIpwx486N1Dr2JTFTuGSPnb8p24D1PDJvg4Bb2EVCXBJqulHyH8sS2FLJtBrYWpFz0wKzhTj776Q0khTbrkuVc7Xun8= X-Received: by 10.129.117.70 with SMTP id q67mr1521383ywc.84.1523563281127; Thu, 12 Apr 2018 13:01:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.200.81.207 with HTTP; Thu, 12 Apr 2018 13:01:20 -0700 (PDT) In-Reply-To: <201804121906.w3CJ6FZo092138@repo.freebsd.org> References: <201804121906.w3CJ6FZo092138@repo.freebsd.org> From: Ryan Stone Date: Thu, 12 Apr 2018 16:01:20 -0400 Message-ID: Subject: Re: svn commit: r332447 - stable/11/sys/dev/ixgbe To: Stephen Hurd Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 20:01:23 -0000 Spinning in the kernel for a full second is a really bad idea. At minimum this is going to hold off all callouts from one of the callout threads for up to a full second as ixgbe_local_timer() waits for the core mutex. That chews up two CPU cores doing busy-wait loops (the ixgbe_stop() thread busy-waits in msec_delay and the callout thread adaptively spins waiting for the mutex). If any other thread tries to acquire the core lock they also adaptively spin on the mutex chewing up yet more cores. This includes any threads trying to fetch interface status (e.g. ifconfig), various interrupt handlers, etc. From owner-svn-src-stable@freebsd.org Fri Apr 13 00:25:54 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC755F9D8C7; Fri, 13 Apr 2018 00:25:53 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 997DA7EDAC; Fri, 13 Apr 2018 00:25:53 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 943B6128AB; Fri, 13 Apr 2018 00:25:53 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3D0Prmq050613; Fri, 13 Apr 2018 00:25:53 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3D0PrhA050612; Fri, 13 Apr 2018 00:25:53 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804130025.w3D0PrhA050612@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 13 Apr 2018 00:25:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332460 - stable/11/usr.sbin/makefs X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/usr.sbin/makefs X-SVN-Commit-Revision: 332460 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 00:25:54 -0000 Author: emaste Date: Fri Apr 13 00:25:53 2018 New Revision: 332460 URL: https://svnweb.freebsd.org/changeset/base/332460 Log: MFC r331758: makefs: sync fragment and block size with newfs r222319 in newfs raised the default blocksize for UFS/FFS filesystems from 16K to 32K and the default fragment size from 2K to 4K, with a rationale that most disks were now running with 4K sectors. Relnotes: Yes Sponsored by: The FreeBSD Foundation Modified: stable/11/usr.sbin/makefs/ffs.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/makefs/ffs.c ============================================================================== --- stable/11/usr.sbin/makefs/ffs.c Thu Apr 12 21:29:40 2018 (r332459) +++ stable/11/usr.sbin/makefs/ffs.c Fri Apr 13 00:25:53 2018 (r332460) @@ -108,8 +108,8 @@ __FBSDID("$FreeBSD$"); /* * Various file system defaults (cribbed from newfs(8)). */ -#define DFL_FRAGSIZE 1024 /* fragment size */ -#define DFL_BLKSIZE 8192 /* block size */ +#define DFL_FRAGSIZE 4096 /* fragment size */ +#define DFL_BLKSIZE 32768 /* block size */ #define DFL_SECSIZE 512 /* sector size */ #define DFL_CYLSPERGROUP 65536 /* cylinders per group */ #define DFL_FRAGSPERINODE 4 /* fragments per inode */ From owner-svn-src-stable@freebsd.org Fri Apr 13 00:29:43 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21C26F9DE51; Fri, 13 Apr 2018 00:29:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C76BA7F080; Fri, 13 Apr 2018 00:29:42 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BDD17128AD; Fri, 13 Apr 2018 00:29:42 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3D0Tgww050787; Fri, 13 Apr 2018 00:29:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3D0Tgpe050785; Fri, 13 Apr 2018 00:29:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201804130029.w3D0Tgpe050785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Apr 2018 00:29:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332461 - stable/11/sys/cam/scsi X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/cam/scsi X-SVN-Commit-Revision: 332461 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 00:29:43 -0000 Author: mav Date: Fri Apr 13 00:29:42 2018 New Revision: 332461 URL: https://svnweb.freebsd.org/changeset/base/332461 Log: MFC r332145: Do not fail devices just for errors in descriptor format. Sponsored by: iXsystems, Inc. Modified: stable/11/sys/cam/scsi/scsi_cd.c stable/11/sys/cam/scsi/scsi_da.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_cd.c Fri Apr 13 00:25:53 2018 (r332460) +++ stable/11/sys/cam/scsi/scsi_cd.c Fri Apr 13 00:29:42 2018 (r332461) @@ -1129,7 +1129,8 @@ cddone(struct cam_periph *periph, union ccb *done_ccb) * supported" (0x25) error. */ if ((have_sense) && (asc != 0x25) - && (error_code == SSD_CURRENT_ERROR)) { + && (error_code == SSD_CURRENT_ERROR + || error_code == SSD_DESC_CURRENT_ERROR)) { const char *sense_key_desc; const char *asc_desc; Modified: stable/11/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_da.c Fri Apr 13 00:25:53 2018 (r332460) +++ stable/11/sys/cam/scsi/scsi_da.c Fri Apr 13 00:29:42 2018 (r332461) @@ -4468,7 +4468,8 @@ dadone(struct cam_periph *periph, union ccb *done_ccb) (((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_INVALID) || ((have_sense) && - (error_code == SSD_CURRENT_ERROR) && + (error_code == SSD_CURRENT_ERROR || + error_code == SSD_DESC_CURRENT_ERROR) && (sense_key == SSD_KEY_ILLEGAL_REQUEST)))) { softc->flags &= ~DA_FLAG_CAN_RC16; free(rdcap, M_SCSIDA); @@ -4485,7 +4486,8 @@ dadone(struct cam_periph *periph, union ccb *done_ccb) * unit not supported" (0x25) error. */ if ((have_sense) && (asc != 0x25) - && (error_code == SSD_CURRENT_ERROR)) { + && (error_code == SSD_CURRENT_ERROR + || error_code == SSD_DESC_CURRENT_ERROR)) { const char *sense_key_desc; const char *asc_desc; From owner-svn-src-stable@freebsd.org Fri Apr 13 02:40:11 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 328F4F8273D; Fri, 13 Apr 2018 02:40:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D9876784D2; Fri, 13 Apr 2018 02:40:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D04DB13D39; Fri, 13 Apr 2018 02:40:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3D2eAYZ015093; Fri, 13 Apr 2018 02:40:10 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3D2eA1K015091; Fri, 13 Apr 2018 02:40:10 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804130240.w3D2eA1K015091@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 13 Apr 2018 02:40:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332462 - stable/11/usr.bin/locate/locate X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/usr.bin/locate/locate X-SVN-Commit-Revision: 332462 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 02:40:11 -0000 Author: kevans Date: Fri Apr 13 02:40:10 2018 New Revision: 332462 URL: https://svnweb.freebsd.org/changeset/base/332462 Log: MFC r306758 (emaste): locate: ANSIfy Modified: stable/11/usr.bin/locate/locate/locate.c stable/11/usr.bin/locate/locate/util.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/locate/locate/locate.c ============================================================================== --- stable/11/usr.bin/locate/locate/locate.c Fri Apr 13 00:29:42 2018 (r332461) +++ stable/11/usr.bin/locate/locate/locate.c Fri Apr 13 02:40:10 2018 (r332462) @@ -134,9 +134,7 @@ extern int check_bigram_char(int); extern char *patprep(char *); int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { register int ch; char **dbv = NULL; @@ -225,10 +223,13 @@ main(argc, argv) } +/* + * Arguments: + * db database + * s search strings + */ void -search_fopen(db, s) - char *db; /* database */ - char **s; /* search strings */ +search_fopen(char *db, char **s) { FILE *fp; #ifdef DEBUG @@ -275,10 +276,13 @@ search_fopen(db, s) } #ifdef MMAP +/* + * Arguments: + * db database + * s search strings + */ void -search_mmap(db, s) - char *db; /* database */ - char **s; /* search strings */ +search_mmap(char *db, char **s) { struct stat sb; int fd; Modified: stable/11/usr.bin/locate/locate/util.c ============================================================================== --- stable/11/usr.bin/locate/locate/util.c Fri Apr 13 00:29:42 2018 (r332461) +++ stable/11/usr.bin/locate/locate/util.c Fri Apr 13 02:40:10 2018 (r332462) @@ -83,10 +83,7 @@ check_bigram_char(ch) * */ char ** -colon(dbv, path, dot) - char **dbv; - char *path; - char *dot; /* default for single ':' */ +colon(char **dbv, char *path, char *dot) { int vlen, slen; char *c, *ch, *p; From owner-svn-src-stable@freebsd.org Fri Apr 13 03:30:11 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A648EF86176; Fri, 13 Apr 2018 03:30:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A40983F07; Fri, 13 Apr 2018 03:30:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55110145B1; Fri, 13 Apr 2018 03:30:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3D3UB1s040691; Fri, 13 Apr 2018 03:30:11 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3D3UAdv040682; Fri, 13 Apr 2018 03:30:10 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804130330.w3D3UAdv040682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 13 Apr 2018 03:30:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332463 - in stable/11: bin/echo bin/sleep usr.bin/basename usr.bin/dc usr.bin/dirname usr.bin/getopt usr.bin/locate/bigram usr.bin/logname usr.bin/printenv usr.bin/yes X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11: bin/echo bin/sleep usr.bin/basename usr.bin/dc usr.bin/dirname usr.bin/getopt usr.bin/locate/bigram usr.bin/logname usr.bin/printenv usr.bin/yes X-SVN-Commit-Revision: 332463 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 03:30:12 -0000 Author: kevans Date: Fri Apr 13 03:30:10 2018 New Revision: 332463 URL: https://svnweb.freebsd.org/changeset/base/332463 Log: MFC r308432, r308657: Capsicumize some trivial stdio programs r308432: Capsicumize some trivial stdio programs Trivially capsicumize some simple programs that just interact with stdio. This list of programs uses 'pledge("stdio")' in OpenBSD. r308657: fold(1): Revert incorrect r308432 As Jean-Sébastien notes, fold(1) requires handling argv-supplied files. That will require a slightly more sophisticated approach. Modified: stable/11/bin/echo/echo.c stable/11/bin/sleep/sleep.c stable/11/usr.bin/basename/basename.c stable/11/usr.bin/dc/dc.c stable/11/usr.bin/dirname/dirname.c stable/11/usr.bin/getopt/getopt.c stable/11/usr.bin/locate/bigram/locate.bigram.c stable/11/usr.bin/logname/logname.c stable/11/usr.bin/printenv/printenv.c stable/11/usr.bin/yes/yes.c Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/echo/echo.c ============================================================================== --- stable/11/bin/echo/echo.c Fri Apr 13 02:40:10 2018 (r332462) +++ stable/11/bin/echo/echo.c Fri Apr 13 03:30:10 2018 (r332463) @@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include @@ -77,6 +79,9 @@ main(int argc, char *argv[]) char space[] = " "; char newline[] = "\n"; char *progname = argv[0]; + + if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); /* This utility may NOT do getopt(3) option parsing. */ if (*++argv && !strcmp(*argv, "-n")) { Modified: stable/11/bin/sleep/sleep.c ============================================================================== --- stable/11/bin/sleep/sleep.c Fri Apr 13 02:40:10 2018 (r332462) +++ stable/11/bin/sleep/sleep.c Fri Apr 13 03:30:10 2018 (r332463) @@ -41,6 +41,7 @@ static char sccsid[] = "@(#)sleep.c 8.3 (Berkeley) 4/2 #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -68,6 +69,9 @@ main(int argc, char *argv[]) double d; time_t original; char buf[2]; + + if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); if (argc != 2) usage(); Modified: stable/11/usr.bin/basename/basename.c ============================================================================== --- stable/11/usr.bin/basename/basename.c Fri Apr 13 02:40:10 2018 (r332462) +++ stable/11/usr.bin/basename/basename.c Fri Apr 13 03:30:10 2018 (r332463) @@ -42,6 +42,7 @@ static char sccsid[] = "@(#)basename.c 8.4 (Berkeley) #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -63,6 +64,9 @@ main(int argc, char **argv) int aflag, ch; setlocale(LC_ALL, ""); + + if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); aflag = 0; suffix = NULL; Modified: stable/11/usr.bin/dc/dc.c ============================================================================== --- stable/11/usr.bin/dc/dc.c Fri Apr 13 02:40:10 2018 (r332462) +++ stable/11/usr.bin/dc/dc.c Fri Apr 13 03:30:10 2018 (r332463) @@ -22,9 +22,11 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include +#include #include #include #include @@ -58,11 +60,11 @@ usage(void) } static void -procfile(char *fname) { +procfd(int fd, char *fname) { struct stat st; FILE *file; - file = fopen(fname, "r"); + file = fdopen(fd, "r"); if (file == NULL) err(1, "cannot open file %s", fname); if (fstat(fileno(file), &st) == -1) @@ -80,7 +82,7 @@ procfile(char *fname) { int main(int argc, char *argv[]) { - int ch; + int ch, fd; bool extended_regs = false, preproc_done = false; /* accept and ignore a single dash to be 4.4BSD dc(1) compatible */ @@ -97,7 +99,10 @@ main(int argc, char *argv[]) case 'f': if (!preproc_done) init_bmachine(extended_regs); - procfile(optarg); + fd = open(optarg, O_RDONLY); + if (fd < 0) + err(1, "cannot open file %s", optarg); + procfd(fd, optarg); preproc_done = true; break; case 'x': @@ -126,12 +131,23 @@ main(int argc, char *argv[]) if (argc > 1) usage(); if (argc == 1) { - procfile(argv[0]); + fd = open(argv[0], O_RDONLY); + if (fd < 0) + err(1, "cannot open file %s", argv[0]); + + if (caph_limit_stream(fd, CAPH_READ) < 0 || + caph_limit_stdio() < 0 || + (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); + + procfd(fd, argv[0]); preproc_done = true; } if (preproc_done) return (0); + if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); src_setstream(&src, stdin); reset_bmachine(&src); eval(); Modified: stable/11/usr.bin/dirname/dirname.c ============================================================================== --- stable/11/usr.bin/dirname/dirname.c Fri Apr 13 02:40:10 2018 (r332462) +++ stable/11/usr.bin/dirname/dirname.c Fri Apr 13 03:30:10 2018 (r332463) @@ -39,6 +39,7 @@ static const char sccsid[] = "@(#)dirname.c 8.4 (Berke #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -52,6 +53,9 @@ main(int argc, char **argv) { char *p; int ch; + + if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); while ((ch = getopt(argc, argv, "")) != -1) switch(ch) { Modified: stable/11/usr.bin/getopt/getopt.c ============================================================================== --- stable/11/usr.bin/getopt/getopt.c Fri Apr 13 02:40:10 2018 (r332462) +++ stable/11/usr.bin/getopt/getopt.c Fri Apr 13 03:30:10 2018 (r332463) @@ -6,6 +6,9 @@ __FBSDID("$FreeBSD$"); * into the public domain and is thus not subject to any copyright. */ +#include +#include +#include #include #include #include @@ -15,6 +18,9 @@ main(int argc, char *argv[]) { int c; int status = 0; + + if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); optind = 2; /* Past the program name and the option letters. */ while ((c = getopt(argc, argv, argv[1])) != -1) Modified: stable/11/usr.bin/locate/bigram/locate.bigram.c ============================================================================== --- stable/11/usr.bin/locate/bigram/locate.bigram.c Fri Apr 13 02:40:10 2018 (r332462) +++ stable/11/usr.bin/locate/bigram/locate.bigram.c Fri Apr 13 03:30:10 2018 (r332463) @@ -57,6 +57,9 @@ static char sccsid[] = "@(#)locate.bigram.c 8.1 (Berke * Use 'code' to encode a file using this output. */ +#include +#include +#include #include #include #include /* for MAXPATHLEN */ @@ -72,6 +75,9 @@ main(void) u_char *cp; u_char *oldpath = buf1, *path = buf2; u_int i, j; + + if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); while (fgets(path, sizeof(buf2), stdin) != NULL) { Modified: stable/11/usr.bin/logname/logname.c ============================================================================== --- stable/11/usr.bin/logname/logname.c Fri Apr 13 02:40:10 2018 (r332462) +++ stable/11/usr.bin/logname/logname.c Fri Apr 13 03:30:10 2018 (r332463) @@ -39,6 +39,7 @@ static const char sccsid[] = "@(#)logname.c 8.2 (Berke #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -50,6 +51,9 @@ int main(int argc, char *argv[] __unused) { char *p; + + if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); if (argc != 1) usage(); Modified: stable/11/usr.bin/printenv/printenv.c ============================================================================== --- stable/11/usr.bin/printenv/printenv.c Fri Apr 13 02:40:10 2018 (r332462) +++ stable/11/usr.bin/printenv/printenv.c Fri Apr 13 03:30:10 2018 (r332463) @@ -44,6 +44,8 @@ __FBSDID("$FreeBSD$"); #include +#include +#include #include #include #include @@ -64,6 +66,9 @@ main(int argc, char *argv[]) char *cp, **ep; size_t len; int ch; + + if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); while ((ch = getopt(argc, argv, "")) != -1) switch(ch) { Modified: stable/11/usr.bin/yes/yes.c ============================================================================== --- stable/11/usr.bin/yes/yes.c Fri Apr 13 02:40:10 2018 (r332462) +++ stable/11/usr.bin/yes/yes.c Fri Apr 13 03:30:10 2018 (r332463) @@ -41,12 +41,17 @@ static const char rcsid[] = "$FreeBSD$"; #endif #endif /* not lint */ +#include #include #include int main(int argc, char **argv) { + + if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); + if (argc > 1) while (puts(argv[1]) != EOF) ; From owner-svn-src-stable@freebsd.org Fri Apr 13 03:32:19 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A379F864DC; Fri, 13 Apr 2018 03:32:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0CA0E8429F; Fri, 13 Apr 2018 03:32:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 079081472B; Fri, 13 Apr 2018 03:32:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3D3WIYr044671; Fri, 13 Apr 2018 03:32:18 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3D3WITY044670; Fri, 13 Apr 2018 03:32:18 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804130332.w3D3WITY044670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 13 Apr 2018 03:32:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332464 - stable/11/usr.bin/yes X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/usr.bin/yes X-SVN-Commit-Revision: 332464 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 03:32:19 -0000 Author: kevans Date: Fri Apr 13 03:32:18 2018 New Revision: 332464 URL: https://svnweb.freebsd.org/changeset/base/332464 Log: MFC r319897-r319898, r319904: Improve yes' throughput r319897: Improve yes' throughput On my system, this brings up the throughput from ~20 to ~600 MiB/s. Inspired by: https://www.reddit.com/r/unix/comments/6gxduc/how_is_gnu_yes_so_fast/ r319898: Handle partial writes r319904: style(9) fixes. Modified: stable/11/usr.bin/yes/yes.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/yes/yes.c ============================================================================== --- stable/11/usr.bin/yes/yes.c Fri Apr 13 03:30:10 2018 (r332463) +++ stable/11/usr.bin/yes/yes.c Fri Apr 13 03:32:18 2018 (r332464) @@ -44,20 +44,43 @@ static const char rcsid[] = "$FreeBSD$"; #include #include #include +#include +#include int main(int argc, char **argv) { + char buf[8192]; + char y[2] = { 'y', '\n' }; + char * exp = y; + size_t buflen = 0; + size_t explen = sizeof(y); + size_t more; + ssize_t ret; if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) err(1, "capsicum"); - if (argc > 1) - while (puts(argv[1]) != EOF) - ; - else - while (puts("y") != EOF) - ; + if (argc > 1) { + exp = argv[1]; + explen = strlen(exp) + 1; + exp[explen - 1] = '\n'; + } + + if (explen <= sizeof(buf)) { + while (buflen < sizeof(buf) - explen) { + memcpy(buf + buflen, exp, explen); + buflen += explen; + } + exp = buf; + explen = buflen; + } + + more = explen; + while ((ret = write(STDOUT_FILENO, exp + (explen - more), more)) > 0) + if ((more -= ret) == 0) + more = explen; + err(1, "stdout"); /*NOTREACHED*/ } From owner-svn-src-stable@freebsd.org Fri Apr 13 03:47:42 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A49EF8758A; Fri, 13 Apr 2018 03:47:42 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 05CEB87286; Fri, 13 Apr 2018 03:47:42 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 009A5148FC; Fri, 13 Apr 2018 03:47:42 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3D3lfG7050580; Fri, 13 Apr 2018 03:47:41 GMT (envelope-from rgrimes@FreeBSD.org) Received: (from rgrimes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3D3lfTx050579; Fri, 13 Apr 2018 03:47:41 GMT (envelope-from rgrimes@FreeBSD.org) Message-Id: <201804130347.w3D3lfTx050579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to rgrimes@FreeBSD.org using -f From: "Rodney W. Grimes" Date: Fri, 13 Apr 2018 03:47:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332465 - in stable: 10/sbin/reboot 11/sbin/reboot X-SVN-Group: stable-10 X-SVN-Commit-Author: rgrimes X-SVN-Commit-Paths: in stable: 10/sbin/reboot 11/sbin/reboot X-SVN-Commit-Revision: 332465 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 03:47:42 -0000 Author: rgrimes Date: Fri Apr 13 03:47:41 2018 New Revision: 332465 URL: https://svnweb.freebsd.org/changeset/base/332465 Log: MFC: r332075 Exit with usage when extra arguments are on command line preventing mistakes such as "halt 0p" for "halt -p". Approved by: bde (mentor, implicit), phk (mentor,implicit) MFC after: 1 week Modified: stable/10/sbin/reboot/reboot.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sbin/reboot/reboot.c Directory Properties: stable/11/ (props changed) Modified: stable/10/sbin/reboot/reboot.c ============================================================================== --- stable/10/sbin/reboot/reboot.c Fri Apr 13 03:32:18 2018 (r332464) +++ stable/10/sbin/reboot/reboot.c Fri Apr 13 03:47:41 2018 (r332465) @@ -111,6 +111,8 @@ main(int argc, char *argv[]) } argc -= optind; argv += optind; + if (argc != 0) + usage(); if ((howto & (RB_DUMP | RB_HALT)) == (RB_DUMP | RB_HALT)) errx(1, "cannot dump (-d) when halting; must reboot instead"); From owner-svn-src-stable@freebsd.org Fri Apr 13 03:47:42 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 871B2F8758B; Fri, 13 Apr 2018 03:47:42 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3A89D87287; Fri, 13 Apr 2018 03:47:42 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 355E8148FD; Fri, 13 Apr 2018 03:47:42 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3D3lgNj050586; Fri, 13 Apr 2018 03:47:42 GMT (envelope-from rgrimes@FreeBSD.org) Received: (from rgrimes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3D3lg3t050585; Fri, 13 Apr 2018 03:47:42 GMT (envelope-from rgrimes@FreeBSD.org) Message-Id: <201804130347.w3D3lg3t050585@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to rgrimes@FreeBSD.org using -f From: "Rodney W. Grimes" Date: Fri, 13 Apr 2018 03:47:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332465 - in stable: 10/sbin/reboot 11/sbin/reboot X-SVN-Group: stable-11 X-SVN-Commit-Author: rgrimes X-SVN-Commit-Paths: in stable: 10/sbin/reboot 11/sbin/reboot X-SVN-Commit-Revision: 332465 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 03:47:42 -0000 Author: rgrimes Date: Fri Apr 13 03:47:41 2018 New Revision: 332465 URL: https://svnweb.freebsd.org/changeset/base/332465 Log: MFC: r332075 Exit with usage when extra arguments are on command line preventing mistakes such as "halt 0p" for "halt -p". Approved by: bde (mentor, implicit), phk (mentor,implicit) MFC after: 1 week Modified: stable/11/sbin/reboot/reboot.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sbin/reboot/reboot.c Directory Properties: stable/10/ (props changed) Modified: stable/11/sbin/reboot/reboot.c ============================================================================== --- stable/11/sbin/reboot/reboot.c Fri Apr 13 03:32:18 2018 (r332464) +++ stable/11/sbin/reboot/reboot.c Fri Apr 13 03:47:41 2018 (r332465) @@ -111,6 +111,8 @@ main(int argc, char *argv[]) } argc -= optind; argv += optind; + if (argc != 0) + usage(); if ((howto & (RB_DUMP | RB_HALT)) == (RB_DUMP | RB_HALT)) errx(1, "cannot dump (-d) when halting; must reboot instead"); From owner-svn-src-stable@freebsd.org Fri Apr 13 17:31:15 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E943F9913E for ; Fri, 13 Apr 2018 17:31:15 +0000 (UTC) (envelope-from shurd@llnw.com) Received: from mail-lf0-x22d.google.com (mail-lf0-x22d.google.com [IPv6:2a00:1450:4010:c07::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 280A377A67 for ; Fri, 13 Apr 2018 17:31:14 +0000 (UTC) (envelope-from shurd@llnw.com) Received: by mail-lf0-x22d.google.com with SMTP id o102-v6so13627111lfg.8 for ; Fri, 13 Apr 2018 10:31:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=llnw.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=75yGyqpLDd5ulEq7wTi62uV6uOCZ4Vdj8lRwptVnnQ8=; b=FrLUdvZXCNfwok1hXtltXPI29IMNdt38AUmI6XMmLrVcyT0+S64xMg79r/m0DqOzlU E+ANZb2p29jwW2Dxi/9QuIxEDl2mADioHSNZCoBGU8s1bqNzJmLlrehBxmc7A5hgzeHZ mQh0CRzIYxzLVmi4GEfXWHsrSYeZF+onFhuHtXT7JCkvaJrXp37uWtz+pVgDniqqDtV5 ENC4ujSpQn9iTAvT/EnkDdvMV4vNoUaj3tbhyY66prqjFen8SERDc5XGBz/GweECDt/2 1E0jKu91UB4QENV+QbEPegsVbhZNXGqrxjFdzh9DppfSiijUUtEPBWoVYzcOzgaJfrEm YjPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=75yGyqpLDd5ulEq7wTi62uV6uOCZ4Vdj8lRwptVnnQ8=; b=EcFtIQwCc6fZg1SDAD3vgWiI5X1/e5hiRVK4yUFBadhX4HT0epDz+sM2Phwx+ys1ov hibt7AFrUaGKGF5dmfWKsH534ZPf/OsYve7uvRR2IhUrWdBbdImWwvBUpkzKg3BXo4pq Zm6O87fj4fz36nGwRVJWanSXnE/7CDTLo0GfydxFnw2uvJINpRxo/AWN3wiaUWrv+vMN 82xHqdfoywLyjIvr7dN39/EoZ7X1NfhuT4N8E43ncW0ZjtKLjphAJKh6LGU/X9FvUMuT tckF4BAQWBVBvq9vyPrMqCDCMWeyLYnIhfCEWnTE4K7iQWptFvzEBgcC5NtggR6eDdSU 4W2A== X-Gm-Message-State: ALQs6tD4cNpu8SdDFbu50oWc4d7ezHIhz+1BIXhM7VPCeiG8lyl2V+D9 cDHJTzsTZ9ncnMTyNGhdUc/PYKRC40I3m893Bh/DGw== X-Google-Smtp-Source: AIpwx4+luufNHF9BKEKkO9AjiDo2Pu/sJUo/xvWyXpCf5td9V08OywhckyKxqrLHNtV+owWlqixYX9h6j3xQ4z7ITx4= X-Received: by 2002:a19:a60a:: with SMTP id p10-v6mr9139646lfe.41.1523640671913; Fri, 13 Apr 2018 10:31:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.134.140 with HTTP; Fri, 13 Apr 2018 10:31:11 -0700 (PDT) In-Reply-To: References: <201804121906.w3CJ6FZo092138@repo.freebsd.org> From: Stephen Hurd Date: Fri, 13 Apr 2018 13:31:11 -0400 Message-ID: Subject: Re: svn commit: r332447 - stable/11/sys/dev/ixgbe To: Ryan Stone Cc: Stephen Hurd , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 17:31:15 -0000 Yeah, I'm looking at the changes that caused this now. Hopefully I'll have this updated today. On Thu, Apr 12, 2018 at 4:01 PM, Ryan Stone wrote: > Spinning in the kernel for a full second is a really bad idea. At > minimum this is going to hold off all callouts from one of the callout > threads for up to a full second as ixgbe_local_timer() waits for the > core mutex. That chews up two CPU cores doing busy-wait loops (the > ixgbe_stop() thread busy-waits in msec_delay and the callout thread > adaptively spins waiting for the mutex). If any other thread tries to > acquire the core lock they also adaptively spin on the mutex chewing > up yet more cores. This includes any threads trying to fetch > interface status (e.g. ifconfig), various interrupt handlers, etc. > -- [image: Limelight Networks] Stephen Hurd* Principal Engineer* EXPERIENCE FIRST. +1 616 848 0643 <+1+616+848+0643> www.limelight.com [image: Facebook] [image: LinkedIn] [image: Twitter] From owner-svn-src-stable@freebsd.org Fri Apr 13 17:45:55 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC5B5F9A2C5; Fri, 13 Apr 2018 17:45:54 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A1A607AAB6; Fri, 13 Apr 2018 17:45:54 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 96A401CEAB; Fri, 13 Apr 2018 17:45:54 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3DHjsBG069351; Fri, 13 Apr 2018 17:45:54 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DHjsTR069349; Fri, 13 Apr 2018 17:45:54 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201804131745.w3DHjsTR069349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Fri, 13 Apr 2018 17:45:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332481 - stable/11/sys/dev/ixgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: stable/11/sys/dev/ixgbe X-SVN-Commit-Revision: 332481 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 17:45:55 -0000 Author: shurd Date: Fri Apr 13 17:45:54 2018 New Revision: 332481 URL: https://svnweb.freebsd.org/changeset/base/332481 Log: Move 1-second spin into ixgbe_netmap_reg() This should still work around the netmap issue, but should not impact other calls to ixgbe_stop(). PR: 221317 Sponsored by: Limelight Networks Modified: stable/11/sys/dev/ixgbe/if_ix.c stable/11/sys/dev/ixgbe/ixgbe_netmap.c Modified: stable/11/sys/dev/ixgbe/if_ix.c ============================================================================== --- stable/11/sys/dev/ixgbe/if_ix.c Fri Apr 13 17:37:39 2018 (r332480) +++ stable/11/sys/dev/ixgbe/if_ix.c Fri Apr 13 17:45:54 2018 (r332481) @@ -3567,8 +3567,6 @@ ixgbe_stop(void *arg) mtx_assert(&adapter->core_mtx, MA_OWNED); - msec_delay(1000); - INIT_DEBUGOUT("ixgbe_stop: begin\n"); ixgbe_disable_intr(adapter); callout_stop(&adapter->timer); Modified: stable/11/sys/dev/ixgbe/ixgbe_netmap.c ============================================================================== --- stable/11/sys/dev/ixgbe/ixgbe_netmap.c Fri Apr 13 17:37:39 2018 (r332480) +++ stable/11/sys/dev/ixgbe/ixgbe_netmap.c Fri Apr 13 17:45:54 2018 (r332481) @@ -151,6 +151,7 @@ ixgbe_netmap_reg(struct netmap_adapter *na, int onoff) struct adapter *adapter = ifp->if_softc; IXGBE_CORE_LOCK(adapter); + msec_delay(1000); adapter->stop_locked(adapter); set_crcstrip(&adapter->hw, onoff); From owner-svn-src-stable@freebsd.org Fri Apr 13 17:57:01 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68DDFF9B1AD; Fri, 13 Apr 2018 17:57:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A39B7D524; Fri, 13 Apr 2018 17:57:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 151051D089; Fri, 13 Apr 2018 17:57:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3DHv0DU074549; Fri, 13 Apr 2018 17:57:00 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DHv0Fs074545; Fri, 13 Apr 2018 17:57:00 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804131757.w3DHv0Fs074545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 13 Apr 2018 17:57:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332482 - in stable/11/usr.bin: head tail X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/usr.bin: head tail X-SVN-Commit-Revision: 332482 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 17:57:01 -0000 Author: kevans Date: Fri Apr 13 17:57:00 2018 New Revision: 332482 URL: https://svnweb.freebsd.org/changeset/base/332482 Log: MFC r332372-r332374: tail(1)/head(1) compatibility long options r332372: tail(1): Add some long options Add --blocks, --bytes, and --lines long options for -b, -c, and -n respectively. This improves tail(1)'s compatibility with its GNU counterpart in a straightforward way. r332373: tail(1): Address mandoc concern (space before punctuation after macro) r332374: head(1): Provide long options Provide long options --bytes and --lines to match -c and -n respectively. This improves head(1)'s compatibility with its GNU counterpart in a sensible way. Modified: stable/11/usr.bin/head/head.1 stable/11/usr.bin/head/head.c stable/11/usr.bin/tail/tail.1 stable/11/usr.bin/tail/tail.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/head/head.1 ============================================================================== --- stable/11/usr.bin/head/head.1 Fri Apr 13 17:45:54 2018 (r332481) +++ stable/11/usr.bin/head/head.1 Fri Apr 13 17:57:00 2018 (r332482) @@ -28,7 +28,7 @@ .\" @(#)head.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd March 16, 2013 +.Dd April 10, 2018 .Dt HEAD 1 .Os .Sh NAME @@ -48,6 +48,18 @@ files are specified. If .Ar count is omitted it defaults to 10. +.Pp +The following options are available: +.Bl -tag -width indent +.It Fl c Ar bytes , Fl -bytes Ns = Ns Ar bytes +Print +.Ar bytes +of each of the specified files. +.It Fl n Ar count , Fl -lines Ns = Ns Ar count +Print +.Ar count +lines of each of the specified files. +.El .Pp If more than a single file is specified, each file is preceded by a header consisting of the string Modified: stable/11/usr.bin/head/head.c ============================================================================== --- stable/11/usr.bin/head/head.c Fri Apr 13 17:45:54 2018 (r332481) +++ stable/11/usr.bin/head/head.c Fri Apr 13 17:57:00 2018 (r332482) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -62,6 +63,13 @@ static void head_bytes(FILE *, off_t); static void obsolete(char *[]); static void usage(void); +static const struct option long_opts[] = +{ + {"bytes", required_argument, NULL, 'c'}, + {"lines", required_argument, NULL, 'n'}, + {NULL, no_argument, NULL, 0} +}; + int main(int argc, char *argv[]) { @@ -72,7 +80,7 @@ main(int argc, char *argv[]) char *ep; obsolete(argv); - while ((ch = getopt(argc, argv, "n:c:")) != -1) + while ((ch = getopt_long(argc, argv, "+n:c:", long_opts, NULL)) != -1) switch(ch) { case 'c': bytecnt = strtoimax(optarg, &ep, 10); Modified: stable/11/usr.bin/tail/tail.1 ============================================================================== --- stable/11/usr.bin/tail/tail.1 Fri Apr 13 17:45:54 2018 (r332481) +++ stable/11/usr.bin/tail/tail.1 Fri Apr 13 17:57:00 2018 (r332482) @@ -31,7 +31,7 @@ .\" @(#)tail.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd March 16, 2013 +.Dd April 10, 2018 .Dt TAIL 1 .Os .Sh NAME @@ -73,11 +73,11 @@ or the last 10 lines of the input. .Pp The options are as follows: .Bl -tag -width indent -.It Fl b Ar number +.It Fl b Ar number , Fl -blocks Ns = Ns Ar number The location is .Ar number 512-byte blocks. -.It Fl c Ar number +.It Fl c Ar number , Fl -bytes Ns = Ns Ar number The location is .Ar number bytes. @@ -112,7 +112,7 @@ The option is the same as the .Fl f option if reading from standard input rather than a file. -.It Fl n Ar number +.It Fl n Ar number , Fl -lines Ns = Ns Ar number The location is .Ar number lines. Modified: stable/11/usr.bin/tail/tail.c ============================================================================== --- stable/11/usr.bin/tail/tail.c Fri Apr 13 17:45:54 2018 (r332481) +++ stable/11/usr.bin/tail/tail.c Fri Apr 13 17:57:00 2018 (r332482) @@ -49,6 +49,7 @@ static const char sccsid[] = "@(#)tail.c 8.1 (Berkeley #include #include +#include #include #include #include @@ -63,6 +64,14 @@ static file_info_t *files; static void obsolete(char **); static void usage(void); +static const struct option long_opts[] = +{ + {"blocks", required_argument, NULL, 'b'}, + {"bytes", required_argument, NULL, 'c'}, + {"lines", required_argument, NULL, 'n'}, + {NULL, no_argument, NULL, 0} +}; + int main(int argc, char *argv[]) { @@ -111,7 +120,8 @@ main(int argc, char *argv[]) obsolete(argv); style = NOTSET; off = 0; - while ((ch = getopt(argc, argv, "Fb:c:fn:qr")) != -1) + while ((ch = getopt_long(argc, argv, "+Fb:c:fn:qr", long_opts, NULL)) != + -1) switch(ch) { case 'F': /* -F is superset of (and implies) -f */ Fflag = fflag = 1; From owner-svn-src-stable@freebsd.org Fri Apr 13 19:15:32 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF7CCFA0569; Fri, 13 Apr 2018 19:15:32 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5FF0B6ED7B; Fri, 13 Apr 2018 19:15:32 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55E8D1DD64; Fri, 13 Apr 2018 19:15:32 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3DJFWm6013998; Fri, 13 Apr 2018 19:15:32 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DJFWDb013997; Fri, 13 Apr 2018 19:15:32 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201804131915.w3DJFWDb013997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 13 Apr 2018 19:15:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332485 - stable/11/gnu/usr.bin X-SVN-Group: stable-11 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: stable/11/gnu/usr.bin X-SVN-Commit-Revision: 332485 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 19:15:32 -0000 Author: ian Date: Fri Apr 13 19:15:31 2018 New Revision: 332485 URL: https://svnweb.freebsd.org/changeset/base/332485 Log: Remove .info debugging output that accidentally got left in for MFC commit. This was just an artifact of my testing to ensure the option had the desired effect on freebsd 11, both when enabled and when disabled. Reported by: Thomas Mueller Point hat: ian@ Modified: stable/11/gnu/usr.bin/Makefile Modified: stable/11/gnu/usr.bin/Makefile ============================================================================== --- stable/11/gnu/usr.bin/Makefile Fri Apr 13 18:25:00 2018 (r332484) +++ stable/11/gnu/usr.bin/Makefile Fri Apr 13 19:15:31 2018 (r332485) @@ -22,8 +22,6 @@ SUBDIR.${MK_GPL_DTC}+= dtc SUBDIR.${MK_RCS}+= rcs SUBDIR.${MK_TESTS}+= tests -.info MK_GNU_DIFF=${MK_GNU_DIFF} - SUBDIR_PARALLEL= .include From owner-svn-src-stable@freebsd.org Fri Apr 13 19:23:02 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3C8CFA105B; Fri, 13 Apr 2018 19:23:01 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7EECC719BA; Fri, 13 Apr 2018 19:23:01 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 79E0B1DF02; Fri, 13 Apr 2018 19:23:01 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3DJN15a018896; Fri, 13 Apr 2018 19:23:01 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DJN1WL018895; Fri, 13 Apr 2018 19:23:01 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201804131923.w3DJN1WL018895@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 13 Apr 2018 19:23:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332486 - stable/11/sys/netpfil/pf X-SVN-Group: stable-11 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/11/sys/netpfil/pf X-SVN-Commit-Revision: 332486 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 19:23:02 -0000 Author: kp Date: Fri Apr 13 19:23:01 2018 New Revision: 332486 URL: https://svnweb.freebsd.org/changeset/base/332486 Log: MFC r332101: pf: Improve ioctl validation for DIOCRADDTABLES and DIOCRDELTABLES The DIOCRADDTABLES and DIOCRDELTABLES ioctls can process a number of tables at a time, and as such try to allocate * sizeof(struct pfr_table). This multiplication can overflow. Thanks to mallocarray() this is not exploitable, but an overflow does panic the system. Arbitrarily limit this to 65535 tables. pfctl only ever processes one table at a time, so it presents no issues there. Modified: stable/11/sys/netpfil/pf/pf_ioctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- stable/11/sys/netpfil/pf/pf_ioctl.c Fri Apr 13 19:15:31 2018 (r332485) +++ stable/11/sys/netpfil/pf/pf_ioctl.c Fri Apr 13 19:23:01 2018 (r332486) @@ -87,6 +87,8 @@ __FBSDID("$FreeBSD$"); #include #endif +#define PF_TABLES_MAX_REQUEST 65535 /* Maximum tables per request. */ + static struct pf_pool *pf_get_pool(char *, u_int32_t, u_int8_t, u_int32_t, u_int8_t, u_int8_t, u_int8_t); @@ -2523,13 +2525,15 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } - totlen = io->pfrio_size * sizeof(struct pfr_table); - pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), - M_TEMP, M_WAITOK); - if (! pfrts) { + + if (io->pfrio_size < 0 || io->pfrio_size > PF_TABLES_MAX_REQUEST) { error = ENOMEM; break; } + + totlen = io->pfrio_size * sizeof(struct pfr_table); + pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), + M_TEMP, M_WAITOK); error = copyin(io->pfrio_buffer, pfrts, totlen); if (error) { free(pfrts, M_TEMP); @@ -2552,13 +2556,15 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } - totlen = io->pfrio_size * sizeof(struct pfr_table); - pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), - M_TEMP, M_WAITOK); - if (! pfrts) { + + if (io->pfrio_size < 0 || io->pfrio_size > PF_TABLES_MAX_REQUEST) { error = ENOMEM; break; } + + totlen = io->pfrio_size * sizeof(struct pfr_table); + pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), + M_TEMP, M_WAITOK); error = copyin(io->pfrio_buffer, pfrts, totlen); if (error) { free(pfrts, M_TEMP); From owner-svn-src-stable@freebsd.org Fri Apr 13 19:23:10 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D822FA10AD; Fri, 13 Apr 2018 19:23:10 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C41971A47; Fri, 13 Apr 2018 19:23:06 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6E4F61DF03; Fri, 13 Apr 2018 19:23:06 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3DJN67t018944; Fri, 13 Apr 2018 19:23:06 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DJN6JZ018943; Fri, 13 Apr 2018 19:23:06 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201804131923.w3DJN6JZ018943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 13 Apr 2018 19:23:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332487 - stable/10/sys/netpfil/pf X-SVN-Group: stable-10 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/10/sys/netpfil/pf X-SVN-Commit-Revision: 332487 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 19:23:10 -0000 Author: kp Date: Fri Apr 13 19:23:06 2018 New Revision: 332487 URL: https://svnweb.freebsd.org/changeset/base/332487 Log: MFC r332101: pf: Improve ioctl validation for DIOCRADDTABLES and DIOCRDELTABLES The DIOCRADDTABLES and DIOCRDELTABLES ioctls can process a number of tables at a time, and as such try to allocate * sizeof(struct pfr_table). This multiplication can overflow. Thanks to mallocarray() this is not exploitable, but an overflow does panic the system. Arbitrarily limit this to 65535 tables. pfctl only ever processes one table at a time, so it presents no issues there. Modified: stable/10/sys/netpfil/pf/pf_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- stable/10/sys/netpfil/pf/pf_ioctl.c Fri Apr 13 19:23:01 2018 (r332486) +++ stable/10/sys/netpfil/pf/pf_ioctl.c Fri Apr 13 19:23:06 2018 (r332487) @@ -83,6 +83,8 @@ __FBSDID("$FreeBSD$"); #include #endif +#define PF_TABLES_MAX_REQUEST 65535 /* Maximum tables per request. */ + static int pfattach(void); static struct pf_pool *pf_get_pool(char *, u_int32_t, u_int8_t, u_int32_t, u_int8_t, u_int8_t, u_int8_t); @@ -2513,13 +2515,15 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } - totlen = io->pfrio_size * sizeof(struct pfr_table); - pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), - M_TEMP, M_WAITOK); - if (! pfrts) { + + if (io->pfrio_size < 0 || io->pfrio_size > PF_TABLES_MAX_REQUEST) { error = ENOMEM; break; } + + totlen = io->pfrio_size * sizeof(struct pfr_table); + pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), + M_TEMP, M_WAITOK); error = copyin(io->pfrio_buffer, pfrts, totlen); if (error) { free(pfrts, M_TEMP); @@ -2542,13 +2546,15 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } - totlen = io->pfrio_size * sizeof(struct pfr_table); - pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), - M_TEMP, M_WAITOK); - if (! pfrts) { + + if (io->pfrio_size < 0 || io->pfrio_size > PF_TABLES_MAX_REQUEST) { error = ENOMEM; break; } + + totlen = io->pfrio_size * sizeof(struct pfr_table); + pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), + M_TEMP, M_WAITOK); error = copyin(io->pfrio_buffer, pfrts, totlen); if (error) { free(pfrts, M_TEMP); From owner-svn-src-stable@freebsd.org Fri Apr 13 21:19:03 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1C55F8266F; Fri, 13 Apr 2018 21:19:03 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 574266B636; Fri, 13 Apr 2018 21:19:03 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5172D1F0C2; Fri, 13 Apr 2018 21:19:03 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3DLJ3aF079215; Fri, 13 Apr 2018 21:19:03 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DLJ3Ze079214; Fri, 13 Apr 2018 21:19:03 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201804132119.w3DLJ3Ze079214@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 13 Apr 2018 21:19:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332491 - stable/11/sys/netpfil/pf X-SVN-Group: stable-11 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/11/sys/netpfil/pf X-SVN-Commit-Revision: 332491 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 21:19:03 -0000 Author: kp Date: Fri Apr 13 21:19:03 2018 New Revision: 332491 URL: https://svnweb.freebsd.org/changeset/base/332491 Log: MFC r332136: pf: Improve ioctl validation for DIOCIGETIFACES and DIOCXCOMMIT These ioctls can process a number of items at a time, which puts us at risk of overflow in mallocarray() and of impossibly large allocations even if we don't overflow. There's no obvious limit to the request size for these, so we limit the requests to something which won't overflow. Change the memory allocation to M_NOWAIT so excessive requests will fail rather than stall forever. Modified: stable/11/sys/netpfil/pf/pf_ioctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- stable/11/sys/netpfil/pf/pf_ioctl.c Fri Apr 13 21:18:04 2018 (r332490) +++ stable/11/sys/netpfil/pf/pf_ioctl.c Fri Apr 13 21:19:03 2018 (r332491) @@ -3115,10 +3115,17 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + + if (io->size < 0 || + WOULD_OVERFLOW(io->size, sizeof(struct pfioc_trans_e))) { + error = EINVAL; + break; + } + totlen = sizeof(struct pfioc_trans_e) * io->size; ioes = mallocarray(io->size, sizeof(struct pfioc_trans_e), - M_TEMP, M_WAITOK); - if (! ioes) { + M_TEMP, M_NOWAIT); + if (ioes == NULL) { error = ENOMEM; break; } @@ -3321,13 +3328,20 @@ DIOCCHANGEADDR_error: break; } + if (io->pfiio_size < 0 || + WOULD_OVERFLOW(io->pfiio_size, sizeof(struct pfi_kif))) { + error = EINVAL; + break; + } + bufsiz = io->pfiio_size * sizeof(struct pfi_kif); ifstore = mallocarray(io->pfiio_size, sizeof(struct pfi_kif), - M_TEMP, M_WAITOK); - if (! ifstore) { + M_TEMP, M_NOWAIT); + if (ifstore == NULL) { error = ENOMEM; break; } + PF_RULES_RLOCK(); pfi_get_ifaces(io->pfiio_name, ifstore, &io->pfiio_size); PF_RULES_RUNLOCK(); From owner-svn-src-stable@freebsd.org Fri Apr 13 21:19:07 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E044F826B8; Fri, 13 Apr 2018 21:19:07 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EDB906B6D8; Fri, 13 Apr 2018 21:19:06 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD0A21F0C3; Fri, 13 Apr 2018 21:19:06 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3DLJ6TI079264; Fri, 13 Apr 2018 21:19:06 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DLJ6fU079263; Fri, 13 Apr 2018 21:19:06 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201804132119.w3DLJ6fU079263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 13 Apr 2018 21:19:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332492 - stable/10/sys/netpfil/pf X-SVN-Group: stable-10 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/10/sys/netpfil/pf X-SVN-Commit-Revision: 332492 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 21:19:07 -0000 Author: kp Date: Fri Apr 13 21:19:06 2018 New Revision: 332492 URL: https://svnweb.freebsd.org/changeset/base/332492 Log: MFC r332136: pf: Improve ioctl validation for DIOCIGETIFACES and DIOCXCOMMIT These ioctls can process a number of items at a time, which puts us at risk of overflow in mallocarray() and of impossibly large allocations even if we don't overflow. There's no obvious limit to the request size for these, so we limit the requests to something which won't overflow. Change the memory allocation to M_NOWAIT so excessive requests will fail rather than stall forever. Modified: stable/10/sys/netpfil/pf/pf_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- stable/10/sys/netpfil/pf/pf_ioctl.c Fri Apr 13 21:19:03 2018 (r332491) +++ stable/10/sys/netpfil/pf/pf_ioctl.c Fri Apr 13 21:19:06 2018 (r332492) @@ -3105,10 +3105,17 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + + if (io->size < 0 || + WOULD_OVERFLOW(io->size, sizeof(struct pfioc_trans_e))) { + error = EINVAL; + break; + } + totlen = sizeof(struct pfioc_trans_e) * io->size; ioes = mallocarray(io->size, sizeof(struct pfioc_trans_e), - M_TEMP, M_WAITOK); - if (! ioes) { + M_TEMP, M_NOWAIT); + if (ioes == NULL) { error = ENOMEM; break; } @@ -3311,13 +3318,20 @@ DIOCCHANGEADDR_error: break; } + if (io->pfiio_size < 0 || + WOULD_OVERFLOW(io->pfiio_size, sizeof(struct pfi_kif))) { + error = EINVAL; + break; + } + bufsiz = io->pfiio_size * sizeof(struct pfi_kif); ifstore = mallocarray(io->pfiio_size, sizeof(struct pfi_kif), - M_TEMP, M_WAITOK); - if (! ifstore) { + M_TEMP, M_NOWAIT); + if (ifstore == NULL) { error = ENOMEM; break; } + PF_RULES_RLOCK(); pfi_get_ifaces(io->pfiio_name, ifstore, &io->pfiio_size); PF_RULES_RUNLOCK(); From owner-svn-src-stable@freebsd.org Fri Apr 13 22:32:29 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39BADF87B81; Fri, 13 Apr 2018 22:32:29 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E04A17C0E7; Fri, 13 Apr 2018 22:32:28 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DAB201FD5F; Fri, 13 Apr 2018 22:32:28 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3DMWSGk019258; Fri, 13 Apr 2018 22:32:28 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DMWSmI019256; Fri, 13 Apr 2018 22:32:28 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804132232.w3DMWSmI019256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 13 Apr 2018 22:32:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332493 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 332493 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 22:32:29 -0000 Author: brooks Date: Fri Apr 13 22:32:28 2018 New Revision: 332493 URL: https://svnweb.freebsd.org/changeset/base/332493 Log: MFC r332088: Add 32-bit compat for ioctls that take struct ifgroupreq. Use an accessor to access ifgr_group and ifgr_groups. Use an macro CASE_IOC_IFGROUPREQ(cmd) in place of case statements such as "case SIOCAIFGROUP:". This avoids poluting the switch statements with large numbers of #ifdefs. Reviewed by: kib Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14960 Modified: stable/11/sys/net/if.c stable/11/sys/net/if.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/if.c ============================================================================== --- stable/11/sys/net/if.c Fri Apr 13 21:19:06 2018 (r332492) +++ stable/11/sys/net/if.c Fri Apr 13 22:32:28 2018 (r332493) @@ -133,8 +133,25 @@ struct ifreq32 { CTASSERT(sizeof(struct ifreq) == sizeof(struct ifreq32)); CTASSERT(__offsetof(struct ifreq, ifr_ifru) == __offsetof(struct ifreq32, ifr_ifru)); -#endif +struct ifgroupreq32 { + char ifgr_name[IFNAMSIZ]; + u_int ifgr_len; + union { + char ifgru_group[IFNAMSIZ]; + uint32_t ifgru_groups; + } ifgr_ifgru; +}; +#define _CASE_IOC_IFGROUPREQ_32(cmd) \ + case _IOC_NEWTYPE((cmd), struct ifgroupreq32): +#else +#define _CASE_IOC_IFGROUPREQ_32(cmd) +#endif /* COMPAT_FREEBSD32 */ + +#define CASE_IOC_IFGROUPREQ(cmd) \ + _CASE_IOC_IFGROUPREQ_32(cmd) \ + case (cmd) + union ifreq_union { struct ifreq ifr; #ifdef COMPAT_FREEBSD32 @@ -142,6 +159,13 @@ union ifreq_union { #endif }; +union ifgroupreq_union { + struct ifgroupreq ifgr; +#ifdef COMPAT_FREEBSD32 + struct ifgroupreq32 ifgr32; +#endif +}; + SYSCTL_NODE(_net, PF_LINK, link, CTLFLAG_RW, 0, "Link layers"); SYSCTL_NODE(_net_link, 0, generic, CTLFLAG_RW, 0, "Generic link-management"); @@ -1490,17 +1514,42 @@ if_delgroups(struct ifnet *ifp) IFNET_WUNLOCK(); } +static char * +ifgr_group_get(void *ifgrp) +{ + union ifgroupreq_union *ifgrup; + + ifgrup = ifgrp; +#ifdef COMPAT_FREEBSD32 + if (SV_CURPROC_FLAG(SV_ILP32)) + return (&ifgrup->ifgr32.ifgr_ifgru.ifgru_group[0]); +#endif + return (&ifgrup->ifgr.ifgr_ifgru.ifgru_group[0]); +} + +static struct ifg_req * +ifgr_groups_get(void *ifgrp) +{ + union ifgroupreq_union *ifgrup; + + ifgrup = ifgrp; +#ifdef COMPAT_FREEBSD32 + if (SV_CURPROC_FLAG(SV_ILP32)) + return ((struct ifg_req *)(uintptr_t) + ifgrup->ifgr32.ifgr_ifgru.ifgru_groups); +#endif + return (ifgrup->ifgr.ifgr_ifgru.ifgru_groups); +} + /* - * Stores all groups from an interface in memory pointed - * to by data + * Stores all groups from an interface in memory pointed to by ifgr. */ static int -if_getgroup(struct ifgroupreq *data, struct ifnet *ifp) +if_getgroup(struct ifgroupreq *ifgr, struct ifnet *ifp) { int len, error; struct ifg_list *ifgl; struct ifg_req ifgrq, *ifgp; - struct ifgroupreq *ifgr = data; if (ifgr->ifgr_len == 0) { IF_ADDR_RLOCK(ifp); @@ -1511,7 +1560,7 @@ if_getgroup(struct ifgroupreq *data, struct ifnet *ifp } len = ifgr->ifgr_len; - ifgp = ifgr->ifgr_groups; + ifgp = ifgr_groups_get(ifgr); /* XXX: wire */ IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifgl, &ifp->if_groups, ifgl_next) { @@ -1535,12 +1584,11 @@ if_getgroup(struct ifgroupreq *data, struct ifnet *ifp } /* - * Stores all members of a group in memory pointed to by data + * Stores all members of a group in memory pointed to by igfr */ static int -if_getgroupmembers(struct ifgroupreq *data) +if_getgroupmembers(struct ifgroupreq *ifgr) { - struct ifgroupreq *ifgr = data; struct ifg_group *ifg; struct ifg_member *ifgm; struct ifg_req ifgrq, *ifgp; @@ -1563,7 +1611,7 @@ if_getgroupmembers(struct ifgroupreq *data) } len = ifgr->ifgr_len; - ifgp = ifgr->ifgr_groups; + ifgp = ifgr_groups_get(ifgr); TAILQ_FOREACH(ifgm, &ifg->ifg_members, ifgm_next) { if (len < sizeof(ifgrq)) { IFNET_RUNLOCK(); @@ -2793,34 +2841,28 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, error = if_gethwaddr(ifp, ifr); break; - case SIOCAIFGROUP: - { - struct ifgroupreq *ifgr = (struct ifgroupreq *)ifr; - + CASE_IOC_IFGROUPREQ(SIOCAIFGROUP): error = priv_check(td, PRIV_NET_ADDIFGROUP); if (error) return (error); - if ((error = if_addgroup(ifp, ifgr->ifgr_group))) + if ((error = if_addgroup(ifp, + ifgr_group_get((struct ifgroupreq *)data)))) return (error); break; - } - case SIOCGIFGROUP: - if ((error = if_getgroup((struct ifgroupreq *)ifr, ifp))) + CASE_IOC_IFGROUPREQ(SIOCGIFGROUP): + if ((error = if_getgroup((struct ifgroupreq *)data, ifp))) return (error); break; - case SIOCDIFGROUP: - { - struct ifgroupreq *ifgr = (struct ifgroupreq *)ifr; - + CASE_IOC_IFGROUPREQ(SIOCDIFGROUP): error = priv_check(td, PRIV_NET_DELIFGROUP); if (error) return (error); - if ((error = if_delgroup(ifp, ifgr->ifgr_group))) + if ((error = if_delgroup(ifp, + ifgr_group_get((struct ifgroupreq *)data)))) return (error); break; - } default: error = ENOIOCTL; @@ -2926,7 +2968,7 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, s error = if_clone_list((struct if_clonereq *)data); CURVNET_RESTORE(); return (error); - case SIOCGIFGMEMB: + CASE_IOC_IFGROUPREQ(SIOCGIFGMEMB): error = if_getgroupmembers((struct ifgroupreq *)data); CURVNET_RESTORE(); return (error); Modified: stable/11/sys/net/if.h ============================================================================== --- stable/11/sys/net/if.h Fri Apr 13 21:19:06 2018 (r332492) +++ stable/11/sys/net/if.h Fri Apr 13 22:32:28 2018 (r332493) @@ -512,8 +512,10 @@ struct ifgroupreq { char ifgru_group[IFNAMSIZ]; struct ifg_req *ifgru_groups; } ifgr_ifgru; +#ifndef _KERNEL #define ifgr_group ifgr_ifgru.ifgru_group #define ifgr_groups ifgr_ifgru.ifgru_groups +#endif }; /* From owner-svn-src-stable@freebsd.org Fri Apr 13 22:33:19 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01B43F87C6D; Fri, 13 Apr 2018 22:33:19 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AB52F7C8FB; Fri, 13 Apr 2018 22:33:18 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A65011FD65; Fri, 13 Apr 2018 22:33:18 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3DMXIr1019364; Fri, 13 Apr 2018 22:33:18 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DMXIEW019361; Fri, 13 Apr 2018 22:33:18 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201804132233.w3DMXIEW019361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 13 Apr 2018 22:33:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332494 - in stable/10/sys: net netpfil/pf X-SVN-Group: stable-10 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in stable/10/sys: net netpfil/pf X-SVN-Commit-Revision: 332494 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 22:33:19 -0000 Author: kp Date: Fri Apr 13 22:33:18 2018 New Revision: 332494 URL: https://svnweb.freebsd.org/changeset/base/332494 Log: MFC r332107: pf: Improve ioctl validation for DIOCRGETTABLES, DIOCRGETTSTATS, DIOCRCLRTSTATS and DIOCRSETTFLAGS These ioctls can process a number of items at a time, which puts us at risk of overflow in mallocarray() and of impossibly large allocations even if we don't overflow. Limit the allocation to required size (or the user allocation, if that's smaller). That does mean we need to do the allocation with the rules lock held (so the number doesn't change while we're doing this), so it can't M_WAITOK. Modified: stable/10/sys/net/pfvar.h stable/10/sys/netpfil/pf/pf_ioctl.c stable/10/sys/netpfil/pf/pf_table.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/pfvar.h ============================================================================== --- stable/10/sys/net/pfvar.h Fri Apr 13 22:32:28 2018 (r332493) +++ stable/10/sys/net/pfvar.h Fri Apr 13 22:33:18 2018 (r332494) @@ -1627,6 +1627,7 @@ void pfr_detach_table(struct pfr_ktable *); int pfr_clr_tables(struct pfr_table *, int *, int); int pfr_add_tables(struct pfr_table *, int, int *, int); int pfr_del_tables(struct pfr_table *, int, int *, int); +int pfr_table_count(struct pfr_table *, int); int pfr_get_tables(struct pfr_table *, struct pfr_table *, int *, int); int pfr_get_tstats(struct pfr_table *, struct pfr_tstats *, int *, int); int pfr_clr_tstats(struct pfr_table *, int, int *, int); Modified: stable/10/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- stable/10/sys/netpfil/pf/pf_ioctl.c Fri Apr 13 22:32:28 2018 (r332493) +++ stable/10/sys/netpfil/pf/pf_ioctl.c Fri Apr 13 22:33:18 2018 (r332494) @@ -2571,20 +2571,25 @@ DIOCCHANGEADDR_error: case DIOCRGETTABLES: { struct pfioc_table *io = (struct pfioc_table *)addr; struct pfr_table *pfrts; - size_t totlen; + size_t totlen, n; if (io->pfrio_esize != sizeof(struct pfr_table)) { error = ENODEV; break; } + PF_RULES_RLOCK(); + n = pfr_table_count(&io->pfrio_table, io->pfrio_flags); + io->pfrio_size = min(io->pfrio_size, n); + totlen = io->pfrio_size * sizeof(struct pfr_table); + pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), - M_TEMP, M_WAITOK); - if (! pfrts) { + M_TEMP, M_NOWAIT); + if (pfrts == NULL) { error = ENOMEM; + PF_RULES_RUNLOCK(); break; } - PF_RULES_RLOCK(); error = pfr_get_tables(&io->pfrio_table, pfrts, &io->pfrio_size, io->pfrio_flags | PFR_FLAG_USERIOCTL); PF_RULES_RUNLOCK(); @@ -2597,20 +2602,24 @@ DIOCCHANGEADDR_error: case DIOCRGETTSTATS: { struct pfioc_table *io = (struct pfioc_table *)addr; struct pfr_tstats *pfrtstats; - size_t totlen; + size_t totlen, n; if (io->pfrio_esize != sizeof(struct pfr_tstats)) { error = ENODEV; break; } + PF_RULES_WLOCK(); + n = pfr_table_count(&io->pfrio_table, io->pfrio_flags); + io->pfrio_size = min(io->pfrio_size, n); + totlen = io->pfrio_size * sizeof(struct pfr_tstats); pfrtstats = mallocarray(io->pfrio_size, - sizeof(struct pfr_tstats), M_TEMP, M_WAITOK); - if (! pfrtstats) { + sizeof(struct pfr_tstats), M_TEMP, M_NOWAIT); + if (pfrtstats == NULL) { error = ENOMEM; + PF_RULES_WUNLOCK(); break; } - PF_RULES_WLOCK(); error = pfr_get_tstats(&io->pfrio_table, pfrtstats, &io->pfrio_size, io->pfrio_flags | PFR_FLAG_USERIOCTL); PF_RULES_WUNLOCK(); @@ -2623,25 +2632,31 @@ DIOCCHANGEADDR_error: case DIOCRCLRTSTATS: { struct pfioc_table *io = (struct pfioc_table *)addr; struct pfr_table *pfrts; - size_t totlen; + size_t totlen, n; if (io->pfrio_esize != sizeof(struct pfr_table)) { error = ENODEV; break; } + + PF_RULES_WLOCK(); + n = pfr_table_count(&io->pfrio_table, io->pfrio_flags); + io->pfrio_size = min(io->pfrio_size, n); + totlen = io->pfrio_size * sizeof(struct pfr_table); pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), - M_TEMP, M_WAITOK); - if (! pfrts) { + M_TEMP, M_NOWAIT); + if (pfrts == NULL) { error = ENOMEM; + PF_RULES_WUNLOCK(); break; } error = copyin(io->pfrio_buffer, pfrts, totlen); if (error) { free(pfrts, M_TEMP); + PF_RULES_WUNLOCK(); break; } - PF_RULES_WLOCK(); error = pfr_clr_tstats(pfrts, io->pfrio_size, &io->pfrio_nzero, io->pfrio_flags | PFR_FLAG_USERIOCTL); PF_RULES_WUNLOCK(); @@ -2652,25 +2667,31 @@ DIOCCHANGEADDR_error: case DIOCRSETTFLAGS: { struct pfioc_table *io = (struct pfioc_table *)addr; struct pfr_table *pfrts; - size_t totlen; + size_t totlen, n; if (io->pfrio_esize != sizeof(struct pfr_table)) { error = ENODEV; break; } + + PF_RULES_WLOCK(); + n = pfr_table_count(&io->pfrio_table, io->pfrio_flags); + io->pfrio_size = min(io->pfrio_size, n); + totlen = io->pfrio_size * sizeof(struct pfr_table); pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), - M_TEMP, M_WAITOK); - if (! pfrts) { + M_TEMP, M_NOWAIT); + if (pfrts == NULL) { error = ENOMEM; + PF_RULES_WUNLOCK(); break; } error = copyin(io->pfrio_buffer, pfrts, totlen); if (error) { free(pfrts, M_TEMP); + PF_RULES_WUNLOCK(); break; } - PF_RULES_WLOCK(); error = pfr_set_tflags(pfrts, io->pfrio_size, io->pfrio_setflag, io->pfrio_clrflag, &io->pfrio_nchange, &io->pfrio_ndel, io->pfrio_flags | PFR_FLAG_USERIOCTL); Modified: stable/10/sys/netpfil/pf/pf_table.c ============================================================================== --- stable/10/sys/netpfil/pf/pf_table.c Fri Apr 13 22:32:28 2018 (r332493) +++ stable/10/sys/netpfil/pf/pf_table.c Fri Apr 13 22:33:18 2018 (r332494) @@ -174,7 +174,6 @@ static struct pfr_ktable *pfr_lookup_table(struct pfr_table *); static void pfr_clean_node_mask(struct pfr_ktable *, struct pfr_kentryworkq *); -static int pfr_table_count(struct pfr_table *, int); static int pfr_skip_table(struct pfr_table *, struct pfr_ktable *, int); static struct pfr_kentry @@ -1680,7 +1679,7 @@ pfr_fix_anchor(char *anchor) return (0); } -static int +int pfr_table_count(struct pfr_table *filter, int flags) { struct pf_ruleset *rs; From owner-svn-src-stable@freebsd.org Fri Apr 13 22:33:51 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B5E1F87D5C; Fri, 13 Apr 2018 22:33:51 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F30F97CEA0; Fri, 13 Apr 2018 22:33:50 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EDF0D1FD66; Fri, 13 Apr 2018 22:33:50 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3DMXof0019436; Fri, 13 Apr 2018 22:33:50 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DMXoOh019433; Fri, 13 Apr 2018 22:33:50 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201804132233.w3DMXoOh019433@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 13 Apr 2018 22:33:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332495 - in stable/11/sys: net netpfil/pf X-SVN-Group: stable-11 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in stable/11/sys: net netpfil/pf X-SVN-Commit-Revision: 332495 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 22:33:51 -0000 Author: kp Date: Fri Apr 13 22:33:50 2018 New Revision: 332495 URL: https://svnweb.freebsd.org/changeset/base/332495 Log: MFC r332107: pf: Improve ioctl validation for DIOCRGETTABLES, DIOCRGETTSTATS, DIOCRCLRTSTATS and DIOCRSETTFLAGS These ioctls can process a number of items at a time, which puts us at risk of overflow in mallocarray() and of impossibly large allocations even if we don't overflow. Limit the allocation to required size (or the user allocation, if that's smaller). That does mean we need to do the allocation with the rules lock held (so the number doesn't change while we're doing this), so it can't M_WAITOK. Modified: stable/11/sys/net/pfvar.h stable/11/sys/netpfil/pf/pf_ioctl.c stable/11/sys/netpfil/pf/pf_table.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/pfvar.h ============================================================================== --- stable/11/sys/net/pfvar.h Fri Apr 13 22:33:18 2018 (r332494) +++ stable/11/sys/net/pfvar.h Fri Apr 13 22:33:50 2018 (r332495) @@ -1633,6 +1633,7 @@ void pfr_detach_table(struct pfr_ktable *); int pfr_clr_tables(struct pfr_table *, int *, int); int pfr_add_tables(struct pfr_table *, int, int *, int); int pfr_del_tables(struct pfr_table *, int, int *, int); +int pfr_table_count(struct pfr_table *, int); int pfr_get_tables(struct pfr_table *, struct pfr_table *, int *, int); int pfr_get_tstats(struct pfr_table *, struct pfr_tstats *, int *, int); int pfr_clr_tstats(struct pfr_table *, int, int *, int); Modified: stable/11/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- stable/11/sys/netpfil/pf/pf_ioctl.c Fri Apr 13 22:33:18 2018 (r332494) +++ stable/11/sys/netpfil/pf/pf_ioctl.c Fri Apr 13 22:33:50 2018 (r332495) @@ -2581,20 +2581,25 @@ DIOCCHANGEADDR_error: case DIOCRGETTABLES: { struct pfioc_table *io = (struct pfioc_table *)addr; struct pfr_table *pfrts; - size_t totlen; + size_t totlen, n; if (io->pfrio_esize != sizeof(struct pfr_table)) { error = ENODEV; break; } + PF_RULES_RLOCK(); + n = pfr_table_count(&io->pfrio_table, io->pfrio_flags); + io->pfrio_size = min(io->pfrio_size, n); + totlen = io->pfrio_size * sizeof(struct pfr_table); + pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), - M_TEMP, M_WAITOK); - if (! pfrts) { + M_TEMP, M_NOWAIT); + if (pfrts == NULL) { error = ENOMEM; + PF_RULES_RUNLOCK(); break; } - PF_RULES_RLOCK(); error = pfr_get_tables(&io->pfrio_table, pfrts, &io->pfrio_size, io->pfrio_flags | PFR_FLAG_USERIOCTL); PF_RULES_RUNLOCK(); @@ -2607,20 +2612,24 @@ DIOCCHANGEADDR_error: case DIOCRGETTSTATS: { struct pfioc_table *io = (struct pfioc_table *)addr; struct pfr_tstats *pfrtstats; - size_t totlen; + size_t totlen, n; if (io->pfrio_esize != sizeof(struct pfr_tstats)) { error = ENODEV; break; } + PF_RULES_WLOCK(); + n = pfr_table_count(&io->pfrio_table, io->pfrio_flags); + io->pfrio_size = min(io->pfrio_size, n); + totlen = io->pfrio_size * sizeof(struct pfr_tstats); pfrtstats = mallocarray(io->pfrio_size, - sizeof(struct pfr_tstats), M_TEMP, M_WAITOK); - if (! pfrtstats) { + sizeof(struct pfr_tstats), M_TEMP, M_NOWAIT); + if (pfrtstats == NULL) { error = ENOMEM; + PF_RULES_WUNLOCK(); break; } - PF_RULES_WLOCK(); error = pfr_get_tstats(&io->pfrio_table, pfrtstats, &io->pfrio_size, io->pfrio_flags | PFR_FLAG_USERIOCTL); PF_RULES_WUNLOCK(); @@ -2633,25 +2642,31 @@ DIOCCHANGEADDR_error: case DIOCRCLRTSTATS: { struct pfioc_table *io = (struct pfioc_table *)addr; struct pfr_table *pfrts; - size_t totlen; + size_t totlen, n; if (io->pfrio_esize != sizeof(struct pfr_table)) { error = ENODEV; break; } + + PF_RULES_WLOCK(); + n = pfr_table_count(&io->pfrio_table, io->pfrio_flags); + io->pfrio_size = min(io->pfrio_size, n); + totlen = io->pfrio_size * sizeof(struct pfr_table); pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), - M_TEMP, M_WAITOK); - if (! pfrts) { + M_TEMP, M_NOWAIT); + if (pfrts == NULL) { error = ENOMEM; + PF_RULES_WUNLOCK(); break; } error = copyin(io->pfrio_buffer, pfrts, totlen); if (error) { free(pfrts, M_TEMP); + PF_RULES_WUNLOCK(); break; } - PF_RULES_WLOCK(); error = pfr_clr_tstats(pfrts, io->pfrio_size, &io->pfrio_nzero, io->pfrio_flags | PFR_FLAG_USERIOCTL); PF_RULES_WUNLOCK(); @@ -2662,25 +2677,31 @@ DIOCCHANGEADDR_error: case DIOCRSETTFLAGS: { struct pfioc_table *io = (struct pfioc_table *)addr; struct pfr_table *pfrts; - size_t totlen; + size_t totlen, n; if (io->pfrio_esize != sizeof(struct pfr_table)) { error = ENODEV; break; } + + PF_RULES_WLOCK(); + n = pfr_table_count(&io->pfrio_table, io->pfrio_flags); + io->pfrio_size = min(io->pfrio_size, n); + totlen = io->pfrio_size * sizeof(struct pfr_table); pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), - M_TEMP, M_WAITOK); - if (! pfrts) { + M_TEMP, M_NOWAIT); + if (pfrts == NULL) { error = ENOMEM; + PF_RULES_WUNLOCK(); break; } error = copyin(io->pfrio_buffer, pfrts, totlen); if (error) { free(pfrts, M_TEMP); + PF_RULES_WUNLOCK(); break; } - PF_RULES_WLOCK(); error = pfr_set_tflags(pfrts, io->pfrio_size, io->pfrio_setflag, io->pfrio_clrflag, &io->pfrio_nchange, &io->pfrio_ndel, io->pfrio_flags | PFR_FLAG_USERIOCTL); Modified: stable/11/sys/netpfil/pf/pf_table.c ============================================================================== --- stable/11/sys/netpfil/pf/pf_table.c Fri Apr 13 22:33:18 2018 (r332494) +++ stable/11/sys/netpfil/pf/pf_table.c Fri Apr 13 22:33:50 2018 (r332495) @@ -175,7 +175,6 @@ static struct pfr_ktable *pfr_lookup_table(struct pfr_table *); static void pfr_clean_node_mask(struct pfr_ktable *, struct pfr_kentryworkq *); -static int pfr_table_count(struct pfr_table *, int); static int pfr_skip_table(struct pfr_table *, struct pfr_ktable *, int); static struct pfr_kentry @@ -1681,7 +1680,7 @@ pfr_fix_anchor(char *anchor) return (0); } -static int +int pfr_table_count(struct pfr_table *filter, int flags) { struct pf_ruleset *rs; From owner-svn-src-stable@freebsd.org Sat Apr 14 00:12:17 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68A62F8E807; Sat, 14 Apr 2018 00:12:17 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1CBEB70BBF; Sat, 14 Apr 2018 00:12:17 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F1AB420D0F; Sat, 14 Apr 2018 00:12:16 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3E0CGIU068408; Sat, 14 Apr 2018 00:12:16 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3E0CGLo068407; Sat, 14 Apr 2018 00:12:16 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201804140012.w3E0CGLo068407@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 14 Apr 2018 00:12:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332496 - stable/11/sys/netpfil/pf X-SVN-Group: stable-11 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/11/sys/netpfil/pf X-SVN-Commit-Revision: 332496 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2018 00:12:17 -0000 Author: kp Date: Sat Apr 14 00:12:16 2018 New Revision: 332496 URL: https://svnweb.freebsd.org/changeset/base/332496 Log: MFC r332142: pf: Improve ioctl validation Ensure that multiplications for memory allocations cannot overflow, and that we'll not try to allocate M_WAITOK for potentially overly large allocations. Modified: stable/11/sys/netpfil/pf/pf_ioctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- stable/11/sys/netpfil/pf/pf_ioctl.c Fri Apr 13 22:33:50 2018 (r332495) +++ stable/11/sys/netpfil/pf/pf_ioctl.c Sat Apr 14 00:12:16 2018 (r332496) @@ -2733,9 +2733,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || + WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { + error = EINVAL; + break; + } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! pfras) { error = ENOMEM; break; @@ -2765,9 +2770,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || + WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { + error = EINVAL; + break; + } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! pfras) { error = ENOMEM; break; @@ -2797,10 +2807,18 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || io->pfrio_size2 < 0) { + error = EINVAL; + break; + } count = max(io->pfrio_size, io->pfrio_size2); + if (WOULD_OVERFLOW(count, sizeof(struct pfr_addr))) { + error = EINVAL; + break; + } totlen = count * sizeof(struct pfr_addr); pfras = mallocarray(count, sizeof(struct pfr_addr), M_TEMP, - M_WAITOK); + M_NOWAIT); if (! pfras) { error = ENOMEM; break; @@ -2831,9 +2849,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || + WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { + error = EINVAL; + break; + } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! pfras) { error = ENOMEM; break; @@ -2857,9 +2880,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || + WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_astats))) { + error = EINVAL; + break; + } totlen = io->pfrio_size * sizeof(struct pfr_astats); pfrastats = mallocarray(io->pfrio_size, - sizeof(struct pfr_astats), M_TEMP, M_WAITOK); + sizeof(struct pfr_astats), M_TEMP, M_NOWAIT); if (! pfrastats) { error = ENOMEM; break; @@ -2883,9 +2911,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || + WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { + error = EINVAL; + break; + } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! pfras) { error = ENOMEM; break; @@ -2915,9 +2948,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || + WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { + error = EINVAL; + break; + } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! pfras) { error = ENOMEM; break; @@ -2947,9 +2985,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || + WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { + error = EINVAL; + break; + } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! pfras) { error = ENOMEM; break; @@ -2994,9 +3037,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->size < 0 || + WOULD_OVERFLOW(io->size, sizeof(struct pfioc_trans_e))) { + error = EINVAL; + break; + } totlen = sizeof(struct pfioc_trans_e) * io->size; ioes = mallocarray(io->size, sizeof(struct pfioc_trans_e), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! ioes) { error = ENOMEM; break; @@ -3065,9 +3113,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->size < 0 || + WOULD_OVERFLOW(io->size, sizeof(struct pfioc_trans_e))) { + error = EINVAL; + break; + } totlen = sizeof(struct pfioc_trans_e) * io->size; ioes = mallocarray(io->size, sizeof(struct pfioc_trans_e), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! ioes) { error = ENOMEM; break; From owner-svn-src-stable@freebsd.org Sat Apr 14 00:20:48 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36C07F8F015; Sat, 14 Apr 2018 00:20:48 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D78AA736CF; Sat, 14 Apr 2018 00:20:47 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D26E920D49; Sat, 14 Apr 2018 00:20:47 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3E0KlKu069549; Sat, 14 Apr 2018 00:20:47 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3E0KlCv069548; Sat, 14 Apr 2018 00:20:47 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201804140020.w3E0KlCv069548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 14 Apr 2018 00:20:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332497 - stable/10/sys/netpfil/pf X-SVN-Group: stable-10 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/10/sys/netpfil/pf X-SVN-Commit-Revision: 332497 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2018 00:20:48 -0000 Author: kp Date: Sat Apr 14 00:20:47 2018 New Revision: 332497 URL: https://svnweb.freebsd.org/changeset/base/332497 Log: MFC r332142: pf: Improve ioctl validation Ensure that multiplications for memory allocations cannot overflow, and that we'll not try to allocate M_WAITOK for potentially overly large allocations. Modified: stable/10/sys/netpfil/pf/pf_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- stable/10/sys/netpfil/pf/pf_ioctl.c Sat Apr 14 00:12:16 2018 (r332496) +++ stable/10/sys/netpfil/pf/pf_ioctl.c Sat Apr 14 00:20:47 2018 (r332497) @@ -2723,9 +2723,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || + WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { + error = EINVAL; + break; + } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! pfras) { error = ENOMEM; break; @@ -2755,9 +2760,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || + WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { + error = EINVAL; + break; + } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! pfras) { error = ENOMEM; break; @@ -2787,10 +2797,18 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || io->pfrio_size2 < 0) { + error = EINVAL; + break; + } count = max(io->pfrio_size, io->pfrio_size2); + if (WOULD_OVERFLOW(count, sizeof(struct pfr_addr))) { + error = EINVAL; + break; + } totlen = count * sizeof(struct pfr_addr); pfras = mallocarray(count, sizeof(struct pfr_addr), M_TEMP, - M_WAITOK); + M_NOWAIT); if (! pfras) { error = ENOMEM; break; @@ -2821,9 +2839,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || + WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { + error = EINVAL; + break; + } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! pfras) { error = ENOMEM; break; @@ -2847,9 +2870,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || + WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_astats))) { + error = EINVAL; + break; + } totlen = io->pfrio_size * sizeof(struct pfr_astats); pfrastats = mallocarray(io->pfrio_size, - sizeof(struct pfr_astats), M_TEMP, M_WAITOK); + sizeof(struct pfr_astats), M_TEMP, M_NOWAIT); if (! pfrastats) { error = ENOMEM; break; @@ -2873,9 +2901,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || + WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { + error = EINVAL; + break; + } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! pfras) { error = ENOMEM; break; @@ -2905,9 +2938,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || + WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { + error = EINVAL; + break; + } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! pfras) { error = ENOMEM; break; @@ -2937,9 +2975,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || + WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { + error = EINVAL; + break; + } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! pfras) { error = ENOMEM; break; @@ -2984,9 +3027,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->size < 0 || + WOULD_OVERFLOW(io->size, sizeof(struct pfioc_trans_e))) { + error = EINVAL; + break; + } totlen = sizeof(struct pfioc_trans_e) * io->size; ioes = mallocarray(io->size, sizeof(struct pfioc_trans_e), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! ioes) { error = ENOMEM; break; @@ -3055,9 +3103,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->size < 0 || + WOULD_OVERFLOW(io->size, sizeof(struct pfioc_trans_e))) { + error = EINVAL; + break; + } totlen = sizeof(struct pfioc_trans_e) * io->size; ioes = mallocarray(io->size, sizeof(struct pfioc_trans_e), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! ioes) { error = ENOMEM; break; From owner-svn-src-stable@freebsd.org Sat Apr 14 11:31:31 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E429F9714F for ; Sat, 14 Apr 2018 11:31:31 +0000 (UTC) (envelope-from bmr@ringman.ch) Received: from mail-yw0-x231.google.com (mail-yw0-x231.google.com [IPv6:2607:f8b0:4002:c05::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 56B6C80D3F for ; Sat, 14 Apr 2018 11:31:30 +0000 (UTC) (envelope-from bmr@ringman.ch) Received: by mail-yw0-x231.google.com with SMTP id i144so4382328ywc.2 for ; Sat, 14 Apr 2018 04:31:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ringman-ch.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=rVE5xTGKHQ6ThJSUHSBmxAqnCyHp7YtzXYQ/Frd2gWc=; b=iy6cvgQOcLa12gJHMyNmDTKXzWOpHs/qCWaffHPRtEFPfgTkQXZKMOSJZHGYDeUn3q uDoQV0EkzZUqtCMGK58ayOdzB1sNSDfhpWXNvB1r3fKb6pioaw0xfTGIYxlzXK6D5jp/ nnbsXdjeyZdZNPB/6v8yA8+RfoaclqSt2uZaDcQ//inxw3Ikb5W6u0/vFgGOWgI5xcwg nTV4vYpJWmtDpFmorels48x3C/T2DBIWQUfbCZOBj8BbQ/2oF4Sx8MNfh2xdI7+BZ8sD 0IVApt+oI4XL7ZV5JBzVA2aSv3WGqFOQ8mUEqA3hHFzqEFWBbMR336ebIzwYcr7jwUw+ fOIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=rVE5xTGKHQ6ThJSUHSBmxAqnCyHp7YtzXYQ/Frd2gWc=; b=s344XaqaU1LmVAfRer/J5BrZmB9kklHa9+om2ELw44/ipsIYWGgHdbhFjxFi6aJLxC +4FYxYdWyrUb8AMIsM19pir3CEhVt/O81h2YYmBRFIy848sS54MG/26M2ZN2jbz/dKCg p4CyaW7q+SjsroxN+q6QsU3aSwfm3k9gbPg3/JVJGWBdHmm3b2Vz8DpuuxaRTya5t/+R BB4ZNJrRir1Fn5k2fG+dLH3UeoiuTNov+ljzkYMyM2FbwipoB3SmKayZtEvqj2/uIXct iDQPKAsOLYXnAkVpYp00crNCENWwg0ZBAmCsqmeeaQNelPeKqHDfWaEyw6/jAQi5/dfr lidw== X-Gm-Message-State: ALQs6tBKd48bcHNA3BxyAYZEWDTTfkReAKIoI2cYjI8P/6bzElS+bPss 8SnGWXCIlnYICGPjUp0hRsB8qz9aYuFP1fjRHZC03g== X-Google-Smtp-Source: AIpwx4/RMtENk43wCV86liDfiiB4UHwM2a8/KXocq75tdJ8i8qLQDFb9OCSWi6kZ9oX3LA6jrupwz1okg5weoGVDOkM= X-Received: by 10.129.51.196 with SMTP id z187mr561409ywz.512.1523705489355; Sat, 14 Apr 2018 04:31:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.129.128.133 with HTTP; Sat, 14 Apr 2018 04:31:28 -0700 (PDT) In-Reply-To: <201804132232.w3DMWSmI019256@repo.freebsd.org> References: <201804132232.w3DMWSmI019256@repo.freebsd.org> From: Magnus Ringman Date: Sat, 14 Apr 2018 13:31:28 +0200 Message-ID: Subject: Re: svn commit: r332493 - stable/11/sys/net To: Brooks Davis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org, freebsd-stable@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2018 11:31:31 -0000 Hi Brooks, this MFC missed your r331077 (https://reviews.freebsd.org/D14706) thus stable buildkernel currently breaks on missing those two macros. (_IOC_NEWLEN and _IOC_NEWTYPE for searchability) Sk=C3=A5l, Magnus On Sat, Apr 14, 2018 at 12:32 AM, Brooks Davis wrote: > Author: brooks > Date: Fri Apr 13 22:32:28 2018 > New Revision: 332493 > URL: https://svnweb.freebsd.org/changeset/base/332493 > > Log: > MFC r332088: > > Add 32-bit compat for ioctls that take struct ifgroupreq. > > Use an accessor to access ifgr_group and ifgr_groups. > > Use an macro CASE_IOC_IFGROUPREQ(cmd) in place of case statements such > as "case SIOCAIFGROUP:". This avoids poluting the switch statements > with large numbers of #ifdefs. > > Reviewed by: kib > Obtained from: CheriBSD > Sponsored by: DARPA, AFRL > Differential Revision: https://reviews.freebsd.org/D14960 > > Modified: > stable/11/sys/net/if.c > stable/11/sys/net/if.h > Directory Properties: > stable/11/ (props changed) > > Modified: stable/11/sys/net/if.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/11/sys/net/if.c Fri Apr 13 21:19:06 2018 (r332492) > +++ stable/11/sys/net/if.c Fri Apr 13 22:32:28 2018 (r332493) > @@ -133,8 +133,25 @@ struct ifreq32 { > CTASSERT(sizeof(struct ifreq) =3D=3D sizeof(struct ifreq32)); > CTASSERT(__offsetof(struct ifreq, ifr_ifru) =3D=3D > __offsetof(struct ifreq32, ifr_ifru)); > -#endif > > +struct ifgroupreq32 { > + char ifgr_name[IFNAMSIZ]; > + u_int ifgr_len; > + union { > + char ifgru_group[IFNAMSIZ]; > + uint32_t ifgru_groups; > + } ifgr_ifgru; > +}; > +#define _CASE_IOC_IFGROUPREQ_32(cmd) \ > + case _IOC_NEWTYPE((cmd), struct ifgroupreq32): > +#else > +#define _CASE_IOC_IFGROUPREQ_32(cmd) > +#endif /* COMPAT_FREEBSD32 */ > + > +#define CASE_IOC_IFGROUPREQ(cmd) \ > + _CASE_IOC_IFGROUPREQ_32(cmd) \ > + case (cmd) > + > union ifreq_union { > struct ifreq ifr; > #ifdef COMPAT_FREEBSD32 > @@ -142,6 +159,13 @@ union ifreq_union { > #endif > }; > > +union ifgroupreq_union { > + struct ifgroupreq ifgr; > +#ifdef COMPAT_FREEBSD32 > + struct ifgroupreq32 ifgr32; > +#endif > +}; > + > SYSCTL_NODE(_net, PF_LINK, link, CTLFLAG_RW, 0, "Link layers"); > SYSCTL_NODE(_net_link, 0, generic, CTLFLAG_RW, 0, "Generic link-manageme= nt"); > > @@ -1490,17 +1514,42 @@ if_delgroups(struct ifnet *ifp) > IFNET_WUNLOCK(); > } > > +static char * > +ifgr_group_get(void *ifgrp) > +{ > + union ifgroupreq_union *ifgrup; > + > + ifgrup =3D ifgrp; > +#ifdef COMPAT_FREEBSD32 > + if (SV_CURPROC_FLAG(SV_ILP32)) > + return (&ifgrup->ifgr32.ifgr_ifgru.ifgru_group[0]); > +#endif > + return (&ifgrup->ifgr.ifgr_ifgru.ifgru_group[0]); > +} > + > +static struct ifg_req * > +ifgr_groups_get(void *ifgrp) > +{ > + union ifgroupreq_union *ifgrup; > + > + ifgrup =3D ifgrp; > +#ifdef COMPAT_FREEBSD32 > + if (SV_CURPROC_FLAG(SV_ILP32)) > + return ((struct ifg_req *)(uintptr_t) > + ifgrup->ifgr32.ifgr_ifgru.ifgru_groups); > +#endif > + return (ifgrup->ifgr.ifgr_ifgru.ifgru_groups); > +} > + > /* > - * Stores all groups from an interface in memory pointed > - * to by data > + * Stores all groups from an interface in memory pointed to by ifgr. > */ > static int > -if_getgroup(struct ifgroupreq *data, struct ifnet *ifp) > +if_getgroup(struct ifgroupreq *ifgr, struct ifnet *ifp) > { > int len, error; > struct ifg_list *ifgl; > struct ifg_req ifgrq, *ifgp; > - struct ifgroupreq *ifgr =3D data; > > if (ifgr->ifgr_len =3D=3D 0) { > IF_ADDR_RLOCK(ifp); > @@ -1511,7 +1560,7 @@ if_getgroup(struct ifgroupreq *data, struct ifnet *= ifp > } > > len =3D ifgr->ifgr_len; > - ifgp =3D ifgr->ifgr_groups; > + ifgp =3D ifgr_groups_get(ifgr); > /* XXX: wire */ > IF_ADDR_RLOCK(ifp); > TAILQ_FOREACH(ifgl, &ifp->if_groups, ifgl_next) { > @@ -1535,12 +1584,11 @@ if_getgroup(struct ifgroupreq *data, struct ifnet= *ifp > } > > /* > - * Stores all members of a group in memory pointed to by data > + * Stores all members of a group in memory pointed to by igfr > */ > static int > -if_getgroupmembers(struct ifgroupreq *data) > +if_getgroupmembers(struct ifgroupreq *ifgr) > { > - struct ifgroupreq *ifgr =3D data; > struct ifg_group *ifg; > struct ifg_member *ifgm; > struct ifg_req ifgrq, *ifgp; > @@ -1563,7 +1611,7 @@ if_getgroupmembers(struct ifgroupreq *data) > } > > len =3D ifgr->ifgr_len; > - ifgp =3D ifgr->ifgr_groups; > + ifgp =3D ifgr_groups_get(ifgr); > TAILQ_FOREACH(ifgm, &ifg->ifg_members, ifgm_next) { > if (len < sizeof(ifgrq)) { > IFNET_RUNLOCK(); > @@ -2793,34 +2841,28 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t = data, > error =3D if_gethwaddr(ifp, ifr); > break; > > - case SIOCAIFGROUP: > - { > - struct ifgroupreq *ifgr =3D (struct ifgroupreq *)ifr; > - > + CASE_IOC_IFGROUPREQ(SIOCAIFGROUP): > error =3D priv_check(td, PRIV_NET_ADDIFGROUP); > if (error) > return (error); > - if ((error =3D if_addgroup(ifp, ifgr->ifgr_group))) > + if ((error =3D if_addgroup(ifp, > + ifgr_group_get((struct ifgroupreq *)data)))) > return (error); > break; > - } > > - case SIOCGIFGROUP: > - if ((error =3D if_getgroup((struct ifgroupreq *)ifr, ifp)= )) > + CASE_IOC_IFGROUPREQ(SIOCGIFGROUP): > + if ((error =3D if_getgroup((struct ifgroupreq *)data, ifp= ))) > return (error); > break; > > - case SIOCDIFGROUP: > - { > - struct ifgroupreq *ifgr =3D (struct ifgroupreq *)ifr; > - > + CASE_IOC_IFGROUPREQ(SIOCDIFGROUP): > error =3D priv_check(td, PRIV_NET_DELIFGROUP); > if (error) > return (error); > - if ((error =3D if_delgroup(ifp, ifgr->ifgr_group))) > + if ((error =3D if_delgroup(ifp, > + ifgr_group_get((struct ifgroupreq *)data)))) > return (error); > break; > - } > > default: > error =3D ENOIOCTL; > @@ -2926,7 +2968,7 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data= , s > error =3D if_clone_list((struct if_clonereq *)data); > CURVNET_RESTORE(); > return (error); > - case SIOCGIFGMEMB: > + CASE_IOC_IFGROUPREQ(SIOCGIFGMEMB): > error =3D if_getgroupmembers((struct ifgroupreq *)data); > CURVNET_RESTORE(); > return (error); > > Modified: stable/11/sys/net/if.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/11/sys/net/if.h Fri Apr 13 21:19:06 2018 (r332492) > +++ stable/11/sys/net/if.h Fri Apr 13 22:32:28 2018 (r332493) > @@ -512,8 +512,10 @@ struct ifgroupreq { > char ifgru_group[IFNAMSIZ]; > struct ifg_req *ifgru_groups; > } ifgr_ifgru; > +#ifndef _KERNEL > #define ifgr_group ifgr_ifgru.ifgru_group > #define ifgr_groups ifgr_ifgru.ifgru_groups > +#endif > }; > > /* > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-stable@freebsd.org Sat Apr 14 11:37:47 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51229F9789D; Sat, 14 Apr 2018 11:37:47 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from mx.catwhisker.org (mx.catwhisker.org [198.144.209.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 911B7826F4; Sat, 14 Apr 2018 11:37:45 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from albert.catwhisker.org (localhost [127.0.0.1]) by albert.catwhisker.org (8.15.2/8.15.2) with ESMTP id w3EBbiNf089599; Sat, 14 Apr 2018 11:37:44 GMT (envelope-from david@albert.catwhisker.org) Received: (from david@localhost) by albert.catwhisker.org (8.15.2/8.15.2/Submit) id w3EBbi0U089598; Sat, 14 Apr 2018 04:37:44 -0700 (PDT) (envelope-from david) Date: Sat, 14 Apr 2018 04:37:43 -0700 From: David Wolfskill To: Magnus Ringman Cc: Brooks Davis , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, freebsd-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r332493 - stable/11/sys/net Message-ID: <20180414113743.GR63353@albert.catwhisker.org> Mail-Followup-To: David Wolfskill , Magnus Ringman , Brooks Davis , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, freebsd-stable@freebsd.org, svn-src-stable-11@freebsd.org References: <201804132232.w3DMWSmI019256@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="E6EZ4qVJn/rWPYaj" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2018 11:37:47 -0000 --E6EZ4qVJn/rWPYaj Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Apr 14, 2018 at 01:31:28PM +0200, Magnus Ringman wrote: > Hi Brooks, this MFC missed your r331077 > (https://reviews.freebsd.org/D14706) thus stable buildkernel currently > breaks on missing those two macros. >=20 > (_IOC_NEWLEN and _IOC_NEWTYPE for searchability) >=20 > Sk=E5l, > Magnus > .... Aye; looks as if that would explain the kernel build failures I had this morning in stable/11, trying to update from r332465 -> r332496. Peace, david --=20 David H. Wolfskill david@catwhisker.org Donald Trump's criticism of others comes across as psychological projection. See http://www.catwhisker.org/~david/publickey.gpg for my public key. --E6EZ4qVJn/rWPYaj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEEzLfO+ReoAfQwZNd7FTnMQKBJ7hcFAlrR6AdfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEND QjdDRUY5MTdBODAxRjQzMDY0RDc3QjE1MzlDQzQwQTA0OUVFMTcACgkQFTnMQKBJ 7hf0PwgA0kLh0HJ7t3RBon/xPvwzgOnZsvfzYtWlT55yXEdkPD91wx8FpNldiZiD T5Vu4G8KUnGAyB2uAlmWesk6r3FikQEEszvCVnCF91ej0ems9naRaJdSEsRaIpyG sO51YaQQ8tDh4Ww/jve9dVVIuBYYEBaPVNzomZS6NP9onD85et6AT4MHdXZsQtY+ hMyoTFryA3AFQq1+OpPyvTUabVCqEqmVSUX5zVX/P+XKrhFMPdCTuFYdkK4+pCAI flfNzhvJqPniCRMCMjKULlpY078gvIUV+QiT3mMBdkPprYotpNxuaFq9NM9VgrXD aHwjasY6eKEmuVSR6fyFj7rVOjqwJg== =Jyh+ -----END PGP SIGNATURE----- --E6EZ4qVJn/rWPYaj-- From owner-svn-src-stable@freebsd.org Sat Apr 14 12:14:38 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63D4AF9AF98 for ; Sat, 14 Apr 2018 12:14:38 +0000 (UTC) (envelope-from bmr@ringman.ch) Received: from mail-yw0-x241.google.com (mail-yw0-x241.google.com [IPv6:2607:f8b0:4002:c05::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 77E076A809 for ; Sat, 14 Apr 2018 12:14:37 +0000 (UTC) (envelope-from bmr@ringman.ch) Received: by mail-yw0-x241.google.com with SMTP id i144so4403334ywc.2 for ; Sat, 14 Apr 2018 05:14:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ringman-ch.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-transfer-encoding; bh=rY6N3rQI39mrJcyNm9PLXqd1kPsZf4ikha0NChDHXQU=; b=pRdrYG16nWQVvWOv+SJdESkPpC1sdZdKDUYnrNPQya6f2cbgxOusGXawXpxUm5Qg5k AEXJis8zmF0cVKVAxUU00Q6//thF2ODp0yKpDjUm3FvD+K9nCLFnj7oxPzneypNorKv5 J1zMghvXmdsFbapqNP6vzmWhOVVYiM77JLd9Fd/iN/s9XJf72MgM+71LCg6EGBSo0a4+ rAhMfFUGjKwykDsiUGBpl6ndG0s0TUXgyIvcbTa+ES3Yeice4YlLFH5nTQLsfMeTIglz eHruIVgRejPrM5xaHwAgo3E7TNjikeEaTQfqtqr/chpQd6b3slLk1U5Ou2p1zGwOEJPf H8kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-transfer-encoding; bh=rY6N3rQI39mrJcyNm9PLXqd1kPsZf4ikha0NChDHXQU=; b=U6FvqgME/RXHdJSFqJ/FKefbCtHbW+9weHOiEF0vBzjuckDL7XpCbwjGmOZfFurHWD OYzk6/hHLGiAFgnFMhZhKNovT3J3uUn/LBNUUWmJfmj3bmf948XAsOHQsGX0l5zOYV+I j9SeycRP4YbzH7xFZh/aoDMquzIU4giAJ8rsKs0v1m/Lrw7Oxb1RfVFGeyMzx3HtKfIy fFkCnKS3O4nN0CGihJlFkI+WpExrEjfbQcGPi/AfMBAFQiwqJz3AZXVx7peIMgiJ/9X1 cOOck3TaGu27ell0itZzMo3OiXnXVCQm1RvfROWQnOtvmD8Hq9JWpnpp/lq2RBMoEVh8 loHA== X-Gm-Message-State: ALQs6tBAC0e14VAzpXD3ZvuH0AmuJftFKZJQHApleKpBC0r5R4Db3tGH 9U1ECek5E0G+nl8RX2RGWlbsxYVzktvok/7uCS5/bg== X-Google-Smtp-Source: AIpwx486PB2fs0L7nZJXd9KvdV81b76W2uah4fEenlwFBtrzwNK2pvnCINlyS5EkZN+VEQHBgk2n1WClPyvXzKihX38= X-Received: by 10.13.216.205 with SMTP id a196mr6787707ywe.442.1523708076965; Sat, 14 Apr 2018 05:14:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.129.128.133 with HTTP; Sat, 14 Apr 2018 05:14:36 -0700 (PDT) In-Reply-To: <20180414113743.GR63353@albert.catwhisker.org> References: <201804132232.w3DMWSmI019256@repo.freebsd.org> <20180414113743.GR63353@albert.catwhisker.org> From: Magnus Ringman Date: Sat, 14 Apr 2018 14:14:36 +0200 Message-ID: Subject: Re: svn commit: r332493 - stable/11/sys/net To: David Wolfskill , Magnus Ringman , Brooks Davis , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, freebsd-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2018 12:14:38 -0000 I don't think anyone has committed a fix yet (I'm not eligible, just lurking here.) Just manually integrate the missing change. At the top of your src tree: patch -p1 << __EOT --- head/sys/sys/ioccom.h 2017/11/20 19:43:44 326023 +++ head/sys/sys/ioccom.h 2018/03/16 22:23:04 331077 @@ -61,6 +61,10 @@ #define _IOW(g,n,t) _IOC(IOC_IN, (g), (n), sizeof(t)) /* this should be _IORW, but stdio got there first */ #define _IOWR(g,n,t) _IOC(IOC_INOUT, (g), (n), sizeof(t)) +/* Replace length/type in an ioctl command. */ +#define _IOC_NEWLEN(ioc, len) \ + (((~(IOCPARM_MASK << 16)) & (ioc)) | (((len) & IOCPARM_MASK) << 16)) +#define _IOC_NEWTYPE(ioc, type) _IOC_NEWLEN((ioc), sizeof(type)) #ifdef _KERNEL __EOT On Sat, Apr 14, 2018 at 1:37 PM, David Wolfskill wro= te: > On Sat, Apr 14, 2018 at 01:31:28PM +0200, Magnus Ringman wrote: >> Hi Brooks, this MFC missed your r331077 >> (https://reviews.freebsd.org/D14706) thus stable buildkernel currently >> breaks on missing those two macros. >> >> (_IOC_NEWLEN and _IOC_NEWTYPE for searchability) >> >> Sk=C3=A5l, >> Magnus >> .... > > Aye; looks as if that would explain the kernel build failures I had this > morning in stable/11, trying to update from r332465 -> r332496. > > Peace, > david > -- > David H. Wolfskill david@catwhisker.org > Donald Trump's criticism of others comes across as psychological projecti= on. > > See http://www.catwhisker.org/~david/publickey.gpg for my public key. From owner-svn-src-stable@freebsd.org Sat Apr 14 12:52:35 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39F1FF9E03C; Sat, 14 Apr 2018 12:52:35 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DBC70749F4; Sat, 14 Apr 2018 12:52:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6D8B2884F; Sat, 14 Apr 2018 12:52:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3ECqYXI048337; Sat, 14 Apr 2018 12:52:34 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3ECqYnd048336; Sat, 14 Apr 2018 12:52:34 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804141252.w3ECqYnd048336@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 14 Apr 2018 12:52:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332502 - stable/11/sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/sys X-SVN-Commit-Revision: 332502 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2018 12:52:35 -0000 Author: emaste Date: Sat Apr 14 12:52:34 2018 New Revision: 332502 URL: https://svnweb.freebsd.org/changeset/base/332502 Log: MFC r331077 (brooks): Add _IOC_NEWLEN() and _IOC_NEWTYPE() macros. These macros take an existing ioctl(2) command and replace the length with the specified length or length of the specified type respectively. These can be used to define commands for 32-bit compatibility with fewer opportunities for cut-and-paste errors then a whole new definition. Obtained from: CheriBSD Sponsored by: DARPA, AFRL Modified: stable/11/sys/sys/ioccom.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sys/ioccom.h ============================================================================== --- stable/11/sys/sys/ioccom.h Sat Apr 14 12:07:05 2018 (r332501) +++ stable/11/sys/sys/ioccom.h Sat Apr 14 12:52:34 2018 (r332502) @@ -59,6 +59,10 @@ #define _IOW(g,n,t) _IOC(IOC_IN, (g), (n), sizeof(t)) /* this should be _IORW, but stdio got there first */ #define _IOWR(g,n,t) _IOC(IOC_INOUT, (g), (n), sizeof(t)) +/* Replace length/type in an ioctl command. */ +#define _IOC_NEWLEN(ioc, len) \ + (((~(IOCPARM_MASK << 16)) & (ioc)) | (((len) & IOCPARM_MASK) << 16)) +#define _IOC_NEWTYPE(ioc, type) _IOC_NEWLEN((ioc), sizeof(type)) #ifdef _KERNEL From owner-svn-src-stable@freebsd.org Sat Apr 14 12:54:36 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B089CF9E332; Sat, 14 Apr 2018 12:54:36 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x22d.google.com (mail-io0-x22d.google.com [IPv6:2607:f8b0:4001:c06::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 33FBA74BA4; Sat, 14 Apr 2018 12:54:36 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x22d.google.com with SMTP id d7so13123285ioc.11; Sat, 14 Apr 2018 05:54:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=HkybOt/pAPEQgxgxjTGZ43QknkXp0iHi6l785MPm6w0=; b=Uz0ZJ7YBBAFkwmzZO22QVOYY2idvDzcoFhfMVtMSvFRlhnpoK6WKuXnuaqNDVboZAN kh7X7DHrDQ6vat/Wi4y5kf8qHJQuxGMCrqoMi44ATEgSPGSqvOWXwnOl5pmW5p17dRtt WpP5qIEgYKQFbfWGkOw5A1P/lEbx2zq3VkwVEp1qP5td6164NtayivtZL/b/x9PM/7rc TkQmJl+CJbNi2uc6hUsK7ibyO9L2maSOjsNuDuIWloasc4ffWKP/4Uv7fpVthad55Poa 2PgMdXIgKEVb0sBzSvVrhWlPkBTsHeZn3RrYWQUHxC8KajmNpUSf0mYuWHHHJhZNlGlZ d4Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=HkybOt/pAPEQgxgxjTGZ43QknkXp0iHi6l785MPm6w0=; b=GVsmI8FNun3oOIj7Cmp2AmwMmjmS1gEJBHt6ZftRD7v5Vi0pxCQYzNIngJ2LWyTjFE IiCnjuL3kZvWygPjw+dkff0GN9xjn/RDOpvo+QyIDM2nPj6GhHNNOs8exqNvPCJ3Vi/L HD0q4L56NbZ8o8PQV5b3BGijjEYvIvQnkXKGC3O77HTMYw2ffa+Vzxsa8kjTJ3rpDk0R uHIpS/t5EFxY0x/AuvpLdCroBSdkCp83hKSuSD6p7KCHUx2YhradffQeQ/PB2PsDHpzn wY6sLSthHrHiN0igrTw038LNaYiCsF6nQsEPsnhSQPUhb3k2RIjBoHp0opAtZRCpIVjU eX0Q== X-Gm-Message-State: ALQs6tAnF9xNOCGZgEG11u45MFh/H1gXQBOQbv9/6tQhtr/XgyjRpsQY LWRlOG2xvX1yng+upxRSK7IPp8S1O4wnatB9fpQvtNiV X-Google-Smtp-Source: AIpwx49L1ajIl970yOcgRDuOb3sucGnQrwW26r+EAFOIT08hb8nXDeXl04Jnne0wd2m2BD7usRtfnNFDBF4xiBhZ4ug= X-Received: by 10.107.134.85 with SMTP id i82mr16437337iod.210.1523710475693; Sat, 14 Apr 2018 05:54:35 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.130.197 with HTTP; Sat, 14 Apr 2018 05:54:15 -0700 (PDT) In-Reply-To: References: <201804132232.w3DMWSmI019256@repo.freebsd.org> From: Ed Maste Date: Sat, 14 Apr 2018 08:54:15 -0400 X-Google-Sender-Auth: N8Gjb2HEZ4WxU3xgarqYqg383Lk Message-ID: Subject: Re: svn commit: r332493 - stable/11/sys/net To: Magnus Ringman Cc: Brooks Davis , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org, freebsd-stable stable Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2018 12:54:36 -0000 On 14 April 2018 at 07:31, Magnus Ringman wrote: > Hi Brooks, this MFC missed your r331077 > (https://reviews.freebsd.org/D14706) thus stable buildkernel currently > breaks on missing those two macros. Thanks for identifying the missing commit Magnus. I've now merged it in r332502. From owner-svn-src-stable@freebsd.org Sat Apr 14 17:41:55 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 913D0F8C46D; Sat, 14 Apr 2018 17:41:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45D1C69D7B; Sat, 14 Apr 2018 17:41:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 40DAE2B5E9; Sat, 14 Apr 2018 17:41:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3EHftiR093680; Sat, 14 Apr 2018 17:41:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3EHfsY9093677; Sat, 14 Apr 2018 17:41:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804141741.w3EHfsY9093677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 14 Apr 2018 17:41:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332505 - in stable/11/sys: amd64/amd64 vm X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys: amd64/amd64 vm X-SVN-Commit-Revision: 332505 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2018 17:41:55 -0000 Author: kib Date: Sat Apr 14 17:41:54 2018 New Revision: 332505 URL: https://svnweb.freebsd.org/changeset/base/332505 Log: MFC r332182: Handle Skylake-X errata SKZ63. Modified: stable/11/sys/amd64/amd64/pmap.c stable/11/sys/vm/vm_page.c stable/11/sys/vm/vm_page.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/pmap.c ============================================================================== --- stable/11/sys/amd64/amd64/pmap.c Sat Apr 14 17:33:16 2018 (r332504) +++ stable/11/sys/amd64/amd64/pmap.c Sat Apr 14 17:41:54 2018 (r332505) @@ -1224,7 +1224,35 @@ pmap_init(void) struct pmap_preinit_mapping *ppim; vm_page_t mpte; vm_size_t s; - int error, i, pv_npg; + int error, i, pv_npg, ret, skz63; + + /* Detect bare-metal Skylake Server and Skylake-X. */ + if (vm_guest == VM_GUEST_NO && cpu_vendor_id == CPU_VENDOR_INTEL && + CPUID_TO_FAMILY(cpu_id) == 0x6 && CPUID_TO_MODEL(cpu_id) == 0x55) { + /* + * Skylake-X errata SKZ63. Processor May Hang When + * Executing Code In an HLE Transaction Region between + * 40000000H and 403FFFFFH. + * + * Mark the pages in the range as preallocated. It + * seems to be impossible to distinguish between + * Skylake Server and Skylake X. + */ + skz63 = 1; + TUNABLE_INT_FETCH("hw.skz63_enable", &skz63); + if (skz63 != 0) { + if (bootverbose) + printf("SKZ63: skipping 4M RAM starting " + "at physical 1G\n"); + for (i = 0; i < atop(0x400000); i++) { + ret = vm_page_blacklist_add(0x40000000 + + ptoa(i), FALSE); + if (!ret && bootverbose) + printf("page at %#lx already used\n", + 0x40000000 + ptoa(i)); + } + } + } /* * Initialize the vm page array entries for the kernel pmap's Modified: stable/11/sys/vm/vm_page.c ============================================================================== --- stable/11/sys/vm/vm_page.c Sat Apr 14 17:33:16 2018 (r332504) +++ stable/11/sys/vm/vm_page.c Sat Apr 14 17:41:54 2018 (r332505) @@ -292,6 +292,27 @@ vm_page_blacklist_next(char **list, char *end) return (0); } +bool +vm_page_blacklist_add(vm_paddr_t pa, bool verbose) +{ + vm_page_t m; + int ret; + + m = vm_phys_paddr_to_vm_page(pa); + if (m == NULL) + return (true); /* page does not exist, no failure */ + + mtx_lock(&vm_page_queue_free_mtx); + ret = vm_phys_unfree_page(m); + mtx_unlock(&vm_page_queue_free_mtx); + if (ret) { + TAILQ_INSERT_TAIL(&blacklist_head, m, listq); + if (verbose) + printf("Skipping page with pa 0x%jx\n", (uintmax_t)pa); + } + return (ret); +} + /* * vm_page_blacklist_check: * @@ -303,26 +324,13 @@ static void vm_page_blacklist_check(char *list, char *end) { vm_paddr_t pa; - vm_page_t m; char *next; - int ret; next = list; while (next != NULL) { if ((pa = vm_page_blacklist_next(&next, end)) == 0) continue; - m = vm_phys_paddr_to_vm_page(pa); - if (m == NULL) - continue; - mtx_lock(&vm_page_queue_free_mtx); - ret = vm_phys_unfree_page(m); - mtx_unlock(&vm_page_queue_free_mtx); - if (ret == TRUE) { - TAILQ_INSERT_TAIL(&blacklist_head, m, listq); - if (bootverbose) - printf("Skipping page with pa 0x%jx\n", - (uintmax_t)pa); - } + vm_page_blacklist_add(pa, bootverbose); } } Modified: stable/11/sys/vm/vm_page.h ============================================================================== --- stable/11/sys/vm/vm_page.h Sat Apr 14 17:33:16 2018 (r332504) +++ stable/11/sys/vm/vm_page.h Sat Apr 14 17:41:54 2018 (r332505) @@ -474,6 +474,7 @@ vm_page_t vm_page_alloc_contig(vm_object_t object, vm_ u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, vm_memattr_t memattr); vm_page_t vm_page_alloc_freelist(int, int); +bool vm_page_blacklist_add(vm_paddr_t pa, bool verbose); void vm_page_change_lock(vm_page_t m, struct mtx **mtx); vm_page_t vm_page_grab (vm_object_t, vm_pindex_t, int); int vm_page_grab_pages(vm_object_t object, vm_pindex_t pindex, int allocflags, From owner-svn-src-stable@freebsd.org Sat Apr 14 20:49:39 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E541FF98DF5; Sat, 14 Apr 2018 20:49:38 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9676173097; Sat, 14 Apr 2018 20:49:38 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D9A02D264; Sat, 14 Apr 2018 20:49:38 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3EKncP2084425; Sat, 14 Apr 2018 20:49:38 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3EKncPY084424; Sat, 14 Apr 2018 20:49:38 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201804142049.w3EKncPY084424@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sat, 14 Apr 2018 20:49:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332507 - stable/11/sys/modules X-SVN-Group: stable-11 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: stable/11/sys/modules X-SVN-Commit-Revision: 332507 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2018 20:49:39 -0000 Author: gonzo Date: Sat Apr 14 20:49:38 2018 New Revision: 332507 URL: https://svnweb.freebsd.org/changeset/base/332507 Log: Fix mis-merge of r329507 in r331501 sus/modules/Makefile part of r329507 just removed ffec while r331501 also added conditional clause for bcm283x_clkman and bcm283x_pwm. Since they're part of another revision, remove mi-merged chunk Modified: stable/11/sys/modules/Makefile Modified: stable/11/sys/modules/Makefile ============================================================================== --- stable/11/sys/modules/Makefile Sat Apr 14 19:07:56 2018 (r332506) +++ stable/11/sys/modules/Makefile Sat Apr 14 20:49:38 2018 (r332507) @@ -826,11 +826,6 @@ _cloudabi64= cloudabi64 .endif -.if ${MACHINE_ARCH:Marmv[67]*} != "" || ${MACHINE_CPUARCH} == "aarch64" -_bcm283x_clkman= bcm283x_clkman -_bcm283x_pwm= bcm283x_pwm -.endif - SUBDIR+=${MODULES_EXTRA} .for reject in ${WITHOUT_MODULES}