From owner-svn-src-stable-12@freebsd.org Sun Mar 17 06:05:20 2019 Return-Path: Delivered-To: svn-src-stable-12@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 8BDC215273B8; Sun, 17 Mar 2019 06:05:20 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 319528ED4D; Sun, 17 Mar 2019 06:05:20 +0000 (UTC) (envelope-from jah@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 08CAA5B51; Sun, 17 Mar 2019 06:05:20 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2H65JC6037754; Sun, 17 Mar 2019 06:05:19 GMT (envelope-from jah@FreeBSD.org) Received: (from jah@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2H65JmM037753; Sun, 17 Mar 2019 06:05:19 GMT (envelope-from jah@FreeBSD.org) Message-Id: <201903170605.x2H65JmM037753@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jah set sender to jah@FreeBSD.org using -f From: "Jason A. Harmening" Date: Sun, 17 Mar 2019 06:05:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345240 - stable/12/sys/ufs/ffs X-SVN-Group: stable-12 X-SVN-Commit-Author: jah X-SVN-Commit-Paths: stable/12/sys/ufs/ffs X-SVN-Commit-Revision: 345240 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 319528ED4D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Mar 2019 06:05:20 -0000 Author: jah Date: Sun Mar 17 06:05:19 2019 New Revision: 345240 URL: https://svnweb.freebsd.org/changeset/base/345240 Log: MFC r344562: FFS: allow sendfile(2) to work with block sizes greater than the page size Implement ffs_getpages_async(), which when possible calls the asynchronous flavor of the generic pager's getpages function. When the underlying block size is larger than the system page size, however, it will invoke the (synchronous) buffer cache pager, followed by a call to the client completion routine. This retains true asynchronous completion in the most common (block size <= page size) case, which is important for the performance of the new sendfile(2). The behavior in the larger block size case mirrors the default implementation of VOP_GETPAGES_ASYNC, which most other filesystems use anyway as they do not override the getpages_async method. PR: 235708 Modified: stable/12/sys/ufs/ffs/ffs_vnops.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- stable/12/sys/ufs/ffs/ffs_vnops.c Sun Mar 17 04:33:17 2019 (r345239) +++ stable/12/sys/ufs/ffs/ffs_vnops.c Sun Mar 17 06:05:19 2019 (r345240) @@ -111,6 +111,7 @@ extern int ffs_rawread(struct vnode *vp, struct uio *u static vop_fdatasync_t ffs_fdatasync; static vop_fsync_t ffs_fsync; static vop_getpages_t ffs_getpages; +static vop_getpages_async_t ffs_getpages_async; static vop_lock1_t ffs_lock; static vop_read_t ffs_read; static vop_write_t ffs_write; @@ -132,7 +133,7 @@ struct vop_vector ffs_vnodeops1 = { .vop_fsync = ffs_fsync, .vop_fdatasync = ffs_fdatasync, .vop_getpages = ffs_getpages, - .vop_getpages_async = vnode_pager_local_getpages_async, + .vop_getpages_async = ffs_getpages_async, .vop_lock1 = ffs_lock, .vop_read = ffs_read, .vop_reallocblks = ffs_reallocblks, @@ -154,7 +155,7 @@ struct vop_vector ffs_vnodeops2 = { .vop_fsync = ffs_fsync, .vop_fdatasync = ffs_fdatasync, .vop_getpages = ffs_getpages, - .vop_getpages_async = vnode_pager_local_getpages_async, + .vop_getpages_async = ffs_getpages_async, .vop_lock1 = ffs_lock, .vop_read = ffs_read, .vop_reallocblks = ffs_reallocblks, @@ -1742,3 +1743,25 @@ ffs_getpages(struct vop_getpages_args *ap) return (vfs_bio_getpages(vp, ap->a_m, ap->a_count, ap->a_rbehind, ap->a_rahead, ffs_gbp_getblkno, ffs_gbp_getblksz)); } + +static int +ffs_getpages_async(struct vop_getpages_async_args *ap) +{ + struct vnode *vp; + struct ufsmount *um; + int error; + + vp = ap->a_vp; + um = VFSTOUFS(vp->v_mount); + + if (um->um_devvp->v_bufobj.bo_bsize <= PAGE_SIZE) + return (vnode_pager_generic_getpages(vp, ap->a_m, ap->a_count, + ap->a_rbehind, ap->a_rahead, ap->a_iodone, ap->a_arg)); + + error = vfs_bio_getpages(vp, ap->a_m, ap->a_count, ap->a_rbehind, + ap->a_rahead, ffs_gbp_getblkno, ffs_gbp_getblksz); + ap->a_iodone(ap->a_arg, ap->a_m, ap->a_count, error); + + return (error); +} + From owner-svn-src-stable-12@freebsd.org Sun Mar 17 13:02:25 2019 Return-Path: Delivered-To: svn-src-stable-12@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 279331539BD7; Sun, 17 Mar 2019 13:02:25 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C0425773A5; Sun, 17 Mar 2019 13:02:24 +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 9D51CA384; Sun, 17 Mar 2019 13:02:24 +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 x2HD2OiZ060570; Sun, 17 Mar 2019 13:02:24 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2HD2OLe060569; Sun, 17 Mar 2019 13:02:24 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201903171302.x2HD2OLe060569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 17 Mar 2019 13:02:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345243 - stable/12/sys/mips/mips X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/mips/mips X-SVN-Commit-Revision: 345243 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C0425773A5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Mar 2019 13:02:25 -0000 Author: kib Date: Sun Mar 17 13:02:24 2019 New Revision: 345243 URL: https://svnweb.freebsd.org/changeset/base/345243 Log: MFC r345141: mips: remove dead comment and definitions. Modified: stable/12/sys/mips/mips/vm_machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/mips/mips/vm_machdep.c ============================================================================== --- stable/12/sys/mips/mips/vm_machdep.c Sun Mar 17 11:27:27 2019 (r345242) +++ stable/12/sys/mips/mips/vm_machdep.c Sun Mar 17 13:02:24 2019 (r345243) @@ -456,14 +456,6 @@ cpu_set_upcall(struct thread *td, void (*entry)(void * } /* - * Implement the pre-zeroed page mechanism. - * This routine is called from the idle loop. - */ - -#define ZIDLE_LO(v) ((v) * 2 / 3) -#define ZIDLE_HI(v) ((v) * 4 / 5) - -/* * Software interrupt handler for queued VM system processing. */ void From owner-svn-src-stable-12@freebsd.org Sun Mar 17 20:30:28 2019 Return-Path: Delivered-To: svn-src-stable-12@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 96FB115494F0; Sun, 17 Mar 2019 20:30:28 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3AA918F528; Sun, 17 Mar 2019 20:30:28 +0000 (UTC) (envelope-from markj@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 2AACCF113; Sun, 17 Mar 2019 20:30:28 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2HKUS0K097150; Sun, 17 Mar 2019 20:30:28 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2HKUREK097147; Sun, 17 Mar 2019 20:30:27 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201903172030.x2HKUREK097147@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 17 Mar 2019 20:30:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345247 - in stable/12/sys: cddl/contrib/opensolaris/uts/common/dtrace cddl/contrib/opensolaris/uts/intel/dtrace cddl/dev/dtrace modules/dtrace X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys: cddl/contrib/opensolaris/uts/common/dtrace cddl/contrib/opensolaris/uts/intel/dtrace cddl/dev/dtrace modules/dtrace X-SVN-Commit-Revision: 345247 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3AA918F528 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Mar 2019 20:30:28 -0000 Author: markj Date: Sun Mar 17 20:30:27 2019 New Revision: 345247 URL: https://svnweb.freebsd.org/changeset/base/345247 Log: MFC r344450, r344452, r344453: Fix a tracepoint lookup race in fasttrap_pid_probe(). Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c stable/12/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c stable/12/sys/cddl/dev/dtrace/dtrace_cddl.h stable/12/sys/modules/dtrace/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Sun Mar 17 18:31:48 2019 (r345246) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Sun Mar 17 20:30:27 2019 (r345247) @@ -1089,6 +1089,8 @@ fasttrap_tracepoint_disable(proc_t *p, fasttrap_probe_ ASSERT(p->p_proc_flag & P_PR_LOCK); #endif p->p_dtrace_count--; + + atomic_add_rel_64(&p->p_fasttrap_tp_gen, 1); } /* Modified: stable/12/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Sun Mar 17 18:31:48 2019 (r345246) +++ stable/12/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Sun Mar 17 20:30:27 2019 (r345247) @@ -967,6 +967,7 @@ fasttrap_pid_probe(struct trapframe *tf) struct reg reg, *rp; proc_t *p = curproc, *pp; struct rm_priotracker tracker; + uint64_t gen; uintptr_t pc; uintptr_t new_pc = 0; fasttrap_bucket_t *bucket; @@ -1026,8 +1027,22 @@ fasttrap_pid_probe(struct trapframe *tf) while (pp->p_vmspace == pp->p_pptr->p_vmspace) pp = pp->p_pptr; pid = pp->p_pid; + if (pp != p) { + PROC_LOCK(pp); + if ((pp->p_flag & P_WEXIT) != 0) { + /* + * This can happen if the child was created with + * rfork(2). Userspace tracing cannot work reliably in + * such a scenario, but we can at least try. + */ + PROC_UNLOCK(pp); + sx_sunlock(&proctree_lock); + return (-1); + } + _PHOLD_LITE(pp); + PROC_UNLOCK(pp); + } sx_sunlock(&proctree_lock); - pp = NULL; rm_rlock(&fasttrap_tp_lock, &tracker); #endif @@ -1051,11 +1066,32 @@ fasttrap_pid_probe(struct trapframe *tf) if (tp == NULL) { #ifdef illumos mutex_exit(pid_mtx); + return (-1); #else rm_runlock(&fasttrap_tp_lock, &tracker); + gen = atomic_load_acq_64(&pp->p_fasttrap_tp_gen); + if (pp != p) + PRELE(pp); + if (curthread->t_fasttrap_tp_gen != gen) { + /* + * At least one tracepoint associated with this PID has + * been removed from the table since #BP was raised. + * Speculate that we hit a tracepoint that has since + * been removed, and retry the instruction. + */ + curthread->t_fasttrap_tp_gen = gen; +#ifdef __amd64 + tf->tf_rip = pc; +#else + tf->tf_eip = pc; #endif + return (0); + } return (-1); +#endif } + if (pp != p) + PRELE(pp); /* * Set the program counter to the address of the traced instruction Modified: stable/12/sys/cddl/dev/dtrace/dtrace_cddl.h ============================================================================== --- stable/12/sys/cddl/dev/dtrace/dtrace_cddl.h Sun Mar 17 18:31:48 2019 (r345246) +++ stable/12/sys/cddl/dev/dtrace/dtrace_cddl.h Sun Mar 17 20:30:27 2019 (r345247) @@ -37,7 +37,7 @@ typedef struct kdtrace_proc { u_int64_t p_dtrace_count; /* Number of DTrace tracepoints */ void *p_dtrace_helpers; /* DTrace helpers, if any */ int p_dtrace_model; - + uint64_t p_fasttrap_tp_gen; /* Tracepoint hash table gen */ } kdtrace_proc_t; /* @@ -86,6 +86,7 @@ typedef struct kdtrace_thread { u_int64_t td_hrtime; /* Last time on cpu. */ void *td_dtrace_sscr; /* Saved scratch space location. */ void *td_systrace_args; /* syscall probe arguments. */ + uint64_t td_fasttrap_tp_gen; /* Tracepoint hash table gen. */ } kdtrace_thread_t; /* @@ -113,10 +114,12 @@ typedef struct kdtrace_thread { #define t_dtrace_regv td_dtrace->td_dtrace_regv #define t_dtrace_sscr td_dtrace->td_dtrace_sscr #define t_dtrace_systrace_args td_dtrace->td_systrace_args +#define t_fasttrap_tp_gen td_dtrace->td_fasttrap_tp_gen #define p_dtrace_helpers p_dtrace->p_dtrace_helpers #define p_dtrace_count p_dtrace->p_dtrace_count #define p_dtrace_probes p_dtrace->p_dtrace_probes #define p_model p_dtrace->p_dtrace_model +#define p_fasttrap_tp_gen p_dtrace->p_fasttrap_tp_gen #define DATAMODEL_NATIVE 0 #ifdef __amd64__ Modified: stable/12/sys/modules/dtrace/Makefile ============================================================================== --- stable/12/sys/modules/dtrace/Makefile Sun Mar 17 18:31:48 2019 (r345246) +++ stable/12/sys/modules/dtrace/Makefile Sun Mar 17 20:30:27 2019 (r345247) @@ -19,9 +19,6 @@ SUBDIR+= fasttrap fbt systrace_linux .if ${MACHINE_CPUARCH} == "amd64" SUBDIR+= systrace_linux32 .endif -.if ${MACHINE_CPUARCH} == "powerpc" -SUBDIR+= fbt fasttrap -.endif .if ${MACHINE_CPUARCH} == "amd64" || \ ${MACHINE_CPUARCH} == "aarch64" || \ ${MACHINE_ARCH} == "mips64" || \ @@ -31,7 +28,9 @@ SUBDIR+= systrace_freebsd32 .if ${MACHINE_CPUARCH} == "aarch64" || \ ${MACHINE_CPUARCH} == "arm" || \ ${MACHINE_CPUARCH} == "mips" || \ + ${MACHINE_CPUARCH} == "powerpc" || \ ${MACHINE_CPUARCH} == "riscv" SUBDIR+= fbt .endif + .include From owner-svn-src-stable-12@freebsd.org Sun Mar 17 20:41:07 2019 Return-Path: Delivered-To: svn-src-stable-12@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 184B61549A35; Sun, 17 Mar 2019 20:41:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B2F9A8FBC0; Sun, 17 Mar 2019 20:41:06 +0000 (UTC) (envelope-from markj@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 8D895F40F; Sun, 17 Mar 2019 20:41:06 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2HKf6v4004926; Sun, 17 Mar 2019 20:41:06 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2HKf6V9004925; Sun, 17 Mar 2019 20:41:06 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201903172041.x2HKf6V9004925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 17 Mar 2019 20:41:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345248 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 345248 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B2F9A8FBC0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Mar 2019 20:41:07 -0000 Author: markj Date: Sun Mar 17 20:41:06 2019 New Revision: 345248 URL: https://svnweb.freebsd.org/changeset/base/345248 Log: MFC r344670: Allow FIONBIO and FIOASYNC ioctls on POSIX shm descriptors. Modified: stable/12/sys/kern/uipc_shm.c Modified: stable/12/sys/kern/uipc_shm.c ============================================================================== --- stable/12/sys/kern/uipc_shm.c Sun Mar 17 20:30:27 2019 (r345247) +++ stable/12/sys/kern/uipc_shm.c Sun Mar 17 20:41:06 2019 (r345248) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -126,6 +127,7 @@ static int shm_remove(char *path, Fnv32_t fnv, struct static fo_rdwr_t shm_read; static fo_rdwr_t shm_write; static fo_truncate_t shm_truncate; +static fo_ioctl_t shm_ioctl; static fo_stat_t shm_stat; static fo_close_t shm_close; static fo_chmod_t shm_chmod; @@ -139,7 +141,7 @@ struct fileops shm_ops = { .fo_read = shm_read, .fo_write = shm_write, .fo_truncate = shm_truncate, - .fo_ioctl = invfo_ioctl, + .fo_ioctl = shm_ioctl, .fo_poll = invfo_poll, .fo_kqfilter = invfo_kqfilter, .fo_stat = shm_stat, @@ -361,6 +363,24 @@ shm_truncate(struct file *fp, off_t length, struct ucr return (error); #endif return (shm_dotruncate(shmfd, length)); +} + +int +shm_ioctl(struct file *fp, u_long com, void *data, struct ucred *active_cred, + struct thread *td) +{ + + switch (com) { + case FIONBIO: + case FIOASYNC: + /* + * Allow fcntl(fd, F_SETFL, O_NONBLOCK) to work, + * just like it would on an unlinked regular file + */ + return (0); + default: + return (ENOTTY); + } } static int From owner-svn-src-stable-12@freebsd.org Sun Mar 17 20:43:02 2019 Return-Path: Delivered-To: svn-src-stable-12@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 9025E1549C4C; Sun, 17 Mar 2019 20:43:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 323EC8FF27; Sun, 17 Mar 2019 20:43:02 +0000 (UTC) (envelope-from markj@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 0B8CDF47B; Sun, 17 Mar 2019 20:43:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2HKh1Me007535; Sun, 17 Mar 2019 20:43:01 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2HKh1Pk007534; Sun, 17 Mar 2019 20:43:01 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201903172043.x2HKh1Pk007534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 17 Mar 2019 20:43:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345249 - stable/12/sys/cddl/contrib/opensolaris/uts/intel/dtrace X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/cddl/contrib/opensolaris/uts/intel/dtrace X-SVN-Commit-Revision: 345249 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 323EC8FF27 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Mar 2019 20:43:02 -0000 Author: markj Date: Sun Mar 17 20:43:01 2019 New Revision: 345249 URL: https://svnweb.freebsd.org/changeset/base/345249 Log: MFC r344588: Remove illumos-specific code from the x86 fasttrap_isa.c. Modified: stable/12/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Sun Mar 17 20:41:06 2019 (r345248) +++ stable/12/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Sun Mar 17 20:43:01 2019 (r345249) @@ -28,21 +28,11 @@ * Use is subject to license terms. */ -#ifdef illumos -#pragma ident "%Z%%M% %I% %E% SMI" -#endif - #include #include #include #include #include -#ifdef illumos -#include -#include -#include -#include -#else #include #include #include @@ -53,14 +43,8 @@ #include #include #include -#endif #include -#ifdef illumos -#include -#include -#else #include -#endif /* illumos */ #ifdef __i386__ #define r_rax r_eax @@ -707,16 +691,9 @@ fasttrap_return_common(struct reg *rp, uintptr_t pc, p fasttrap_tracepoint_t *tp; fasttrap_bucket_t *bucket; fasttrap_id_t *id; -#ifdef illumos - kmutex_t *pid_mtx; - - pid_mtx = &cpu_core[CPU->cpu_id].cpuc_pid_lock; - mutex_enter(pid_mtx); -#else struct rm_priotracker tracker; rm_rlock(&fasttrap_tp_lock, &tracker); -#endif bucket = &fasttrap_tpoints.fth_table[FASTTRAP_TPOINTS_INDEX(pid, pc)]; for (tp = bucket->ftb_data; tp != NULL; tp = tp->ftt_next) { @@ -731,11 +708,7 @@ fasttrap_return_common(struct reg *rp, uintptr_t pc, p * is not essential to the correct execution of the process. */ if (tp == NULL) { -#ifdef illumos - mutex_exit(pid_mtx); -#else rm_runlock(&fasttrap_tp_lock, &tracker); -#endif return; } @@ -756,30 +729,12 @@ fasttrap_return_common(struct reg *rp, uintptr_t pc, p rp->r_rax, rp->r_rbx, 0, 0); } -#ifdef illumos - mutex_exit(pid_mtx); -#else rm_runlock(&fasttrap_tp_lock, &tracker); -#endif } static void fasttrap_sigsegv(proc_t *p, kthread_t *t, uintptr_t addr) { -#ifdef illumos - sigqueue_t *sqp = kmem_zalloc(sizeof (sigqueue_t), KM_SLEEP); - - sqp->sq_info.si_signo = SIGSEGV; - sqp->sq_info.si_code = SEGV_MAPERR; - sqp->sq_info.si_addr = (caddr_t)addr; - - mutex_enter(&p->p_lock); - sigaddqa(p, t, sqp); - mutex_exit(&p->p_lock); - - if (t != NULL) - aston(t); -#else ksiginfo_t *ksi = kmem_zalloc(sizeof (ksiginfo_t), KM_SLEEP); ksiginfo_init(ksi); @@ -787,7 +742,6 @@ fasttrap_sigsegv(proc_t *p, kthread_t *t, uintptr_t ad ksi->ksi_code = SEGV_MAPERR; ksi->ksi_addr = (caddr_t)addr; (void) tdksignal(t, SIGSEGV, ksi); -#endif } #ifdef __amd64 @@ -971,9 +925,6 @@ fasttrap_pid_probe(struct trapframe *tf) uintptr_t pc; uintptr_t new_pc = 0; fasttrap_bucket_t *bucket; -#ifdef illumos - kmutex_t *pid_mtx; -#endif fasttrap_tracepoint_t *tp, tp_local; pid_t pid; dtrace_icookie_t cookie; @@ -1013,15 +964,6 @@ fasttrap_pid_probe(struct trapframe *tf) * parent. We know that there's only one thread of control in such a * process: this one. */ -#ifdef illumos - while (p->p_flag & SVFORK) { - p = p->p_parent; - } - - pid = p->p_pid; - pid_mtx = &cpu_core[CPU->cpu_id].cpuc_pid_lock; - mutex_enter(pid_mtx); -#else pp = p; sx_slock(&proctree_lock); while (pp->p_vmspace == pp->p_pptr->p_vmspace) @@ -1045,7 +987,6 @@ fasttrap_pid_probe(struct trapframe *tf) sx_sunlock(&proctree_lock); rm_rlock(&fasttrap_tp_lock, &tracker); -#endif bucket = &fasttrap_tpoints.fth_table[FASTTRAP_TPOINTS_INDEX(pid, pc)]; @@ -1064,10 +1005,6 @@ fasttrap_pid_probe(struct trapframe *tf) * fasttrap_ioctl), or somehow we have mislaid this tracepoint. */ if (tp == NULL) { -#ifdef illumos - mutex_exit(pid_mtx); - return (-1); -#else rm_runlock(&fasttrap_tp_lock, &tracker); gen = atomic_load_acq_64(&pp->p_fasttrap_tp_gen); if (pp != p) @@ -1088,7 +1025,6 @@ fasttrap_pid_probe(struct trapframe *tf) return (0); } return (-1); -#endif } if (pp != p) PRELE(pp); @@ -1210,11 +1146,7 @@ fasttrap_pid_probe(struct trapframe *tf) * tracepoint again later if we need to light up any return probes. */ tp_local = *tp; -#ifdef illumos - mutex_exit(pid_mtx); -#else rm_runlock(&fasttrap_tp_lock, &tracker); -#endif tp = &tp_local; /* @@ -1534,28 +1466,6 @@ fasttrap_pid_probe(struct trapframe *tf) uint8_t scratch[2 * FASTTRAP_MAX_INSTR_SIZE + 7]; #endif uint_t i = 0; -#ifdef illumos - klwp_t *lwp = ttolwp(curthread); - - /* - * Compute the address of the ulwp_t and step over the - * ul_self pointer. The method used to store the user-land - * thread pointer is very different on 32- and 64-bit - * kernels. - */ -#if defined(__amd64) - if (p->p_model == DATAMODEL_LP64) { - addr = lwp->lwp_pcb.pcb_fsbase; - addr += sizeof (void *); - } else { - addr = lwp->lwp_pcb.pcb_gsbase; - addr += sizeof (caddr32_t); - } -#else - addr = USD_GETBASE(&lwp->lwp_pcb.pcb_gsdesc); - addr += sizeof (void *); -#endif -#else /* !illumos */ fasttrap_scrspace_t *scrspace; scrspace = fasttrap_scraddr(curthread, tp->ftt_proc); if (scrspace == NULL) { @@ -1571,7 +1481,6 @@ fasttrap_pid_probe(struct trapframe *tf) break; } addr = scrspace->ftss_addr; -#endif /* illumos */ /* * Generic Instruction Tracing @@ -1813,11 +1722,9 @@ done: rp->r_rip = new_pc; -#ifndef illumos PROC_LOCK(p); proc_write_regs(curthread, rp); PROC_UNLOCK(p); -#endif return (0); } From owner-svn-src-stable-12@freebsd.org Sun Mar 17 20:43:32 2019 Return-Path: Delivered-To: svn-src-stable-12@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 8B6471549CA4; Sun, 17 Mar 2019 20:43:32 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F4CA90049; Sun, 17 Mar 2019 20:43:32 +0000 (UTC) (envelope-from markj@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 0B494F47C; Sun, 17 Mar 2019 20:43:32 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2HKhVc7007602; Sun, 17 Mar 2019 20:43:31 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2HKhVtE007600; Sun, 17 Mar 2019 20:43:31 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201903172043.x2HKhVtE007600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 17 Mar 2019 20:43:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345250 - in stable/12/sys/cddl/contrib/opensolaris/uts: common/dtrace intel/dtrace X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys/cddl/contrib/opensolaris/uts: common/dtrace intel/dtrace X-SVN-Commit-Revision: 345250 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2F4CA90049 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Mar 2019 20:43:32 -0000 Author: markj Date: Sun Mar 17 20:43:31 2019 New Revision: 345250 URL: https://svnweb.freebsd.org/changeset/base/345250 Log: MFC r344599: Fix fasttrap_sig{trap,segv}(). Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c stable/12/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Sun Mar 17 20:43:01 2019 (r345249) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Sun Mar 17 20:43:31 2019 (r345250) @@ -291,30 +291,15 @@ fasttrap_hash_str(const char *p) void fasttrap_sigtrap(proc_t *p, kthread_t *t, uintptr_t pc) { -#ifdef illumos - sigqueue_t *sqp = kmem_zalloc(sizeof (sigqueue_t), KM_SLEEP); + ksiginfo_t ksi; - sqp->sq_info.si_signo = SIGTRAP; - sqp->sq_info.si_code = TRAP_DTRACE; - sqp->sq_info.si_addr = (caddr_t)pc; - - mutex_enter(&p->p_lock); - sigaddqa(p, t, sqp); - mutex_exit(&p->p_lock); - - if (t != NULL) - aston(t); -#else - ksiginfo_t *ksi = kmem_zalloc(sizeof (ksiginfo_t), KM_SLEEP); - - ksiginfo_init(ksi); - ksi->ksi_signo = SIGTRAP; - ksi->ksi_code = TRAP_DTRACE; - ksi->ksi_addr = (caddr_t)pc; + ksiginfo_init(&ksi); + ksi.ksi_signo = SIGTRAP; + ksi.ksi_code = TRAP_DTRACE; + ksi.ksi_addr = (caddr_t)pc; PROC_LOCK(p); - (void) tdsendsignal(p, t, SIGTRAP, ksi); + (void)tdsendsignal(p, t, SIGTRAP, &ksi); PROC_UNLOCK(p); -#endif } #ifndef illumos Modified: stable/12/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Sun Mar 17 20:43:01 2019 (r345249) +++ stable/12/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Sun Mar 17 20:43:31 2019 (r345250) @@ -735,13 +735,15 @@ fasttrap_return_common(struct reg *rp, uintptr_t pc, p static void fasttrap_sigsegv(proc_t *p, kthread_t *t, uintptr_t addr) { - ksiginfo_t *ksi = kmem_zalloc(sizeof (ksiginfo_t), KM_SLEEP); + ksiginfo_t ksi; - ksiginfo_init(ksi); - ksi->ksi_signo = SIGSEGV; - ksi->ksi_code = SEGV_MAPERR; - ksi->ksi_addr = (caddr_t)addr; - (void) tdksignal(t, SIGSEGV, ksi); + ksiginfo_init(&ksi); + ksi.ksi_signo = SIGSEGV; + ksi.ksi_code = SEGV_MAPERR; + ksi.ksi_addr = (caddr_t)addr; + PROC_LOCK(p); + (void)tdksignal(t, SIGSEGV, &ksi); + PROC_UNLOCK(p); } #ifdef __amd64 From owner-svn-src-stable-12@freebsd.org Mon Mar 18 02:56:52 2019 Return-Path: Delivered-To: svn-src-stable-12@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 AC754152AC54; Mon, 18 Mar 2019 02:56:52 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 505A26C8E1; Mon, 18 Mar 2019 02:56:52 +0000 (UTC) (envelope-from avos@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 25D721B3A1; Mon, 18 Mar 2019 02:56:52 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2I2uqhV000355; Mon, 18 Mar 2019 02:56:52 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2I2upYh000353; Mon, 18 Mar 2019 02:56:51 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201903180256.x2I2upYh000353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 18 Mar 2019 02:56:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345253 - in stable/12/sys/dev/rtwn/rtl8192c: . usb X-SVN-Group: stable-12 X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in stable/12/sys/dev/rtwn/rtl8192c: . usb X-SVN-Commit-Revision: 345253 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 505A26C8E1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Mar 2019 02:56:52 -0000 Author: avos Date: Mon Mar 18 02:56:51 2019 New Revision: 345253 URL: https://svnweb.freebsd.org/changeset/base/345253 Log: MFC r344745: rtwn_usb(4): fix Tx instability with RTL8192CU chipsets PR: 233949 Modified: stable/12/sys/dev/rtwn/rtl8192c/r92c_reg.h stable/12/sys/dev/rtwn/rtl8192c/r92c_tx.c stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu_init.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/rtwn/rtl8192c/r92c_reg.h ============================================================================== --- stable/12/sys/dev/rtwn/rtl8192c/r92c_reg.h Mon Mar 18 02:40:22 2019 (r345252) +++ stable/12/sys/dev/rtwn/rtl8192c/r92c_reg.h Mon Mar 18 02:56:51 2019 (r345253) @@ -148,6 +148,7 @@ #define R92C_RD_RESP_PKT_TH 0x463 #define R92C_INIRTS_RATE_SEL 0x480 #define R92C_INIDATA_RATE_SEL(macid) (0x484 + (macid)) +#define R92C_POWER_STATUS 0x4a4 #define R92C_QUEUE_CTRL 0x4c6 #define R92C_MAX_AGGR_NUM 0x4ca #define R92C_BAR_MODE_CTRL 0x4cc Modified: stable/12/sys/dev/rtwn/rtl8192c/r92c_tx.c ============================================================================== --- stable/12/sys/dev/rtwn/rtl8192c/r92c_tx.c Mon Mar 18 02:40:22 2019 (r345252) +++ stable/12/sys/dev/rtwn/rtl8192c/r92c_tx.c Mon Mar 18 02:56:51 2019 (r345253) @@ -211,6 +211,12 @@ r92c_tx_setup_macid(void *buf, int id) struct r92c_tx_desc *txd = (struct r92c_tx_desc *)buf; txd->txdw1 |= htole32(SM(R92C_TXDW1_MACID, id)); + + /* XXX does not belong here */ + /* XXX temporary (I hope) */ + /* Force CCK1 for RTS / CTS frames (driver bug) */ + txd->txdw4 &= ~htole32(SM(R92C_TXDW4_RTSRATE, R92C_TXDW4_RTSRATE_M)); + txd->txdw4 &= ~htole32(R92C_TXDW4_RTS_SHORT); } void Modified: stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu_init.c ============================================================================== --- stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu_init.c Mon Mar 18 02:40:22 2019 (r345252) +++ stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu_init.c Mon Mar 18 02:56:51 2019 (r345253) @@ -357,6 +357,8 @@ void r92cu_post_init(struct rtwn_softc *sc) { + rtwn_write_4(sc, R92C_POWER_STATUS, 0x5); + /* Perform LO and IQ calibrations. */ r92c_iq_calib(sc); /* Perform LC calibration. */ From owner-svn-src-stable-12@freebsd.org Mon Mar 18 09:21:31 2019 Return-Path: Delivered-To: svn-src-stable-12@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 D4EB01536B63; Mon, 18 Mar 2019 09:21:31 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 76DD877916; Mon, 18 Mar 2019 09:21:31 +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 517541F4FC; Mon, 18 Mar 2019 09:21:31 +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 x2I9LV9F098231; Mon, 18 Mar 2019 09:21:31 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2I9LVfK098230; Mon, 18 Mar 2019 09:21:31 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201903180921.x2I9LVfK098230@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 18 Mar 2019 09:21:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345256 - stable/12/sys/netpfil/ipfw/nat64 X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/12/sys/netpfil/ipfw/nat64 X-SVN-Commit-Revision: 345256 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 76DD877916 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.942,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Mar 2019 09:21:32 -0000 Author: ae Date: Mon Mar 18 09:21:30 2019 New Revision: 345256 URL: https://svnweb.freebsd.org/changeset/base/345256 Log: MFC r345003: Add NULL pointer check to nat64_output(). It is possible that a processed packet was originated by local host, in this case m->m_pkthdr.rcvif is NULL. Check and set it to V_loif to avoid NULL pointer dereference in IP input code, since it is expected that packet has valid receiving interface when netisr processes it. Obtained from: Yandex LLC Sponsored by: Yandex LLC Modified: stable/12/sys/netpfil/ipfw/nat64/nat64_translate.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netpfil/ipfw/nat64/nat64_translate.c ============================================================================== --- stable/12/sys/netpfil/ipfw/nat64/nat64_translate.c Mon Mar 18 05:03:55 2019 (r345255) +++ stable/12/sys/netpfil/ipfw/nat64/nat64_translate.c Mon Mar 18 09:21:30 2019 (r345256) @@ -219,6 +219,8 @@ nat64_output(struct ifnet *ifp, struct mbuf *m, struct } if (logdata != NULL) nat64_log(logdata, m, af); + if (m->m_pkthdr.rcvif == NULL) + m->m_pkthdr.rcvif = V_loif; ret = netisr_queue(ret, m); if (ret != 0) NAT64STAT_INC(stats, oerrors); From owner-svn-src-stable-12@freebsd.org Mon Mar 18 09:28:54 2019 Return-Path: Delivered-To: svn-src-stable-12@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 D339B1536F34; Mon, 18 Mar 2019 09:28:54 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 721F880036; Mon, 18 Mar 2019 09:28:54 +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 4BAEB1F66F; Mon, 18 Mar 2019 09:28:54 +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 x2I9SsQk003533; Mon, 18 Mar 2019 09:28:54 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2I9SrVq003532; Mon, 18 Mar 2019 09:28:53 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201903180928.x2I9SrVq003532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 18 Mar 2019 09:28:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345258 - stable/12/sys/netpfil/ipfw X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/12/sys/netpfil/ipfw X-SVN-Commit-Revision: 345258 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 721F880036 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.942,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Mar 2019 09:28:55 -0000 Author: ae Date: Mon Mar 18 09:28:53 2019 New Revision: 345258 URL: https://svnweb.freebsd.org/changeset/base/345258 Log: MFC r345004 (with modification): Add IP_FW_NAT64 to codes that ipfw_chk() can return. It will be used by upcoming NAT64 changes. We use separate code to avoid propagating EACCES error code to user level applications when NAT64 consumes a packet. Obtained from: Yandex LLC Sponsored by: Yandex LLC Modified: stable/12/sys/netpfil/ipfw/ip_fw_pfil.c stable/12/sys/netpfil/ipfw/ip_fw_private.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netpfil/ipfw/ip_fw_pfil.c ============================================================================== --- stable/12/sys/netpfil/ipfw/ip_fw_pfil.c Mon Mar 18 09:23:15 2019 (r345257) +++ stable/12/sys/netpfil/ipfw/ip_fw_pfil.c Mon Mar 18 09:28:53 2019 (r345258) @@ -313,6 +313,10 @@ again: case IP_FW_REASS: goto again; /* continue with packet */ + case IP_FW_NAT64: + ret = 0; + break; + default: KASSERT(0, ("%s: unknown retval", __func__)); } Modified: stable/12/sys/netpfil/ipfw/ip_fw_private.h ============================================================================== --- stable/12/sys/netpfil/ipfw/ip_fw_private.h Mon Mar 18 09:23:15 2019 (r345257) +++ stable/12/sys/netpfil/ipfw/ip_fw_private.h Mon Mar 18 09:28:53 2019 (r345258) @@ -61,6 +61,7 @@ enum { IP_FW_NGTEE, IP_FW_NAT, IP_FW_REASS, + IP_FW_NAT64, }; /* From owner-svn-src-stable-12@freebsd.org Mon Mar 18 10:25:37 2019 Return-Path: Delivered-To: svn-src-stable-12@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 259291538C47; Mon, 18 Mar 2019 10:25:37 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C0D4482418; Mon, 18 Mar 2019 10:25:36 +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 8F5422007E; Mon, 18 Mar 2019 10:25:36 +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 x2IAPa95034472; Mon, 18 Mar 2019 10:25:36 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2IAPaQp034471; Mon, 18 Mar 2019 10:25:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201903181025.x2IAPaQp034471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 18 Mar 2019 10:25:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345260 - stable/12/sys/x86/include X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/x86/include X-SVN-Commit-Revision: 345260 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C0D4482418 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Mar 2019 10:25:37 -0000 Author: kib Date: Mon Mar 18 10:25:36 2019 New Revision: 345260 URL: https://svnweb.freebsd.org/changeset/base/345260 Log: MFC r345189: Add symbolic name for TSC_AUX MSR address. Modified: stable/12/sys/x86/include/specialreg.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/x86/include/specialreg.h ============================================================================== --- stable/12/sys/x86/include/specialreg.h Mon Mar 18 09:31:23 2019 (r345259) +++ stable/12/sys/x86/include/specialreg.h Mon Mar 18 10:25:36 2019 (r345260) @@ -997,6 +997,7 @@ #define MSR_FSBASE 0xc0000100 /* base address of the %fs "segment" */ #define MSR_GSBASE 0xc0000101 /* base address of the %gs "segment" */ #define MSR_KGSBASE 0xc0000102 /* base address of the kernel %gs */ +#define MSR_TSC_AUX 0xc0000103 #define MSR_PERFEVSEL0 0xc0010000 #define MSR_PERFEVSEL1 0xc0010001 #define MSR_PERFEVSEL2 0xc0010002 From owner-svn-src-stable-12@freebsd.org Mon Mar 18 12:04:45 2019 Return-Path: Delivered-To: svn-src-stable-12@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 0D236153C92D; Mon, 18 Mar 2019 12:04:45 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AFF5485F1B; Mon, 18 Mar 2019 12:04:44 +0000 (UTC) (envelope-from fsu@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 8BB99211A2; Mon, 18 Mar 2019 12:04:44 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2IC4ifB087408; Mon, 18 Mar 2019 12:04:44 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2IC4hdW087404; Mon, 18 Mar 2019 12:04:43 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <201903181204.x2IC4hdW087404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Mon, 18 Mar 2019 12:04:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345265 - stable/12/sys/fs/ext2fs X-SVN-Group: stable-12 X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: stable/12/sys/fs/ext2fs X-SVN-Commit-Revision: 345265 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AFF5485F1B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Mar 2019 12:04:45 -0000 Author: fsu Date: Mon Mar 18 12:04:43 2019 New Revision: 345265 URL: https://svnweb.freebsd.org/changeset/base/345265 Log: MFC r344751: Make superblock reading logic more strict. Add more on-disk superblock consistency checks to ext2_compute_sb_data() function. It should decrease the probability of mounting filesystems with corrupted superblock data. Reviewed by: pfg Differential Revision: https://reviews.freebsd.org/D19322 Modified: stable/12/sys/fs/ext2fs/ext2_alloc.c stable/12/sys/fs/ext2fs/ext2_extern.h stable/12/sys/fs/ext2fs/ext2_vfsops.c stable/12/sys/fs/ext2fs/ext2fs.h Modified: stable/12/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_alloc.c Mon Mar 18 11:44:53 2019 (r345264) +++ stable/12/sys/fs/ext2fs/ext2_alloc.c Mon Mar 18 12:04:43 2019 (r345265) @@ -457,7 +457,7 @@ noinodes: /* * 64-bit compatible getters and setters for struct ext2_gd from ext2fs.h */ -static uint64_t +uint64_t e2fs_gd_get_b_bitmap(struct ext2_gd *gd) { @@ -465,7 +465,7 @@ e2fs_gd_get_b_bitmap(struct ext2_gd *gd) gd->ext2bgd_b_bitmap); } -static uint64_t +uint64_t e2fs_gd_get_i_bitmap(struct ext2_gd *gd) { @@ -754,7 +754,7 @@ ext2_hashalloc(struct inode *ip, int cg, long pref, in return (0); } -static unsigned long +static uint64_t ext2_cg_number_gdb_nometa(struct m_ext2fs *fs, int cg) { @@ -768,7 +768,7 @@ ext2_cg_number_gdb_nometa(struct m_ext2fs *fs, int cg) EXT2_DESCS_PER_BLOCK(fs)); } -static unsigned long +static uint64_t ext2_cg_number_gdb_meta(struct m_ext2fs *fs, int cg) { unsigned long metagroup; @@ -784,7 +784,7 @@ ext2_cg_number_gdb_meta(struct m_ext2fs *fs, int cg) return (0); } -static unsigned long +uint64_t ext2_cg_number_gdb(struct m_ext2fs *fs, int cg) { unsigned long first_meta_bg, metagroup; Modified: stable/12/sys/fs/ext2fs/ext2_extern.h ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_extern.h Mon Mar 18 11:44:53 2019 (r345264) +++ stable/12/sys/fs/ext2fs/ext2_extern.h Mon Mar 18 12:04:43 2019 (r345265) @@ -91,6 +91,7 @@ int ext2_dirrewrite(struct inode *, int ext2_dirempty(struct inode *, ino_t, struct ucred *); int ext2_checkpath(struct inode *, struct inode *, struct ucred *); int ext2_cg_has_sb(struct m_ext2fs *fs, int cg); +uint64_t ext2_cg_number_gdb(struct m_ext2fs *fs, int cg); int ext2_inactive(struct vop_inactive_args *); int ext2_htree_add_entry(struct vnode *, struct ext2fs_direct_2 *, struct componentname *); @@ -104,6 +105,8 @@ int ext2_htree_lookup(struct inode *, const char *, in int ext2_search_dirblock(struct inode *, void *, int *, const char *, int, int *, doff_t *, doff_t *, doff_t *, struct ext2fs_searchslot *); uint32_t e2fs_gd_get_ndirs(struct ext2_gd *gd); +uint64_t e2fs_gd_get_b_bitmap(struct ext2_gd *); +uint64_t e2fs_gd_get_i_bitmap(struct ext2_gd *); uint64_t e2fs_gd_get_i_tables(struct ext2_gd *); void ext2_sb_csum_set_seed(struct m_ext2fs *); int ext2_sb_csum_verify(struct m_ext2fs *); Modified: stable/12/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_vfsops.c Mon Mar 18 11:44:53 2019 (r345264) +++ stable/12/sys/fs/ext2fs/ext2_vfsops.c Mon Mar 18 12:04:43 2019 (r345265) @@ -98,7 +98,7 @@ VFS_SET(ext2fs_vfsops, ext2fs, 0); static int ext2_check_sb_compat(struct ext2fs *es, struct cdev *dev, int ronly); -static int compute_sb_data(struct vnode * devvp, +static int ext2_compute_sb_data(struct vnode * devvp, struct ext2fs * es, struct m_ext2fs * fs); static const char *ext2_opts[] = { "acls", "async", "noatime", "noclusterr", @@ -321,7 +321,7 @@ ext2_check_sb_compat(struct ext2fs *es, struct cdev *d } static e4fs_daddr_t -cg_location(struct m_ext2fs *fs, int number) +ext2_cg_location(struct m_ext2fs *fs, int number) { int cg, descpb, logical_sb, has_super = 0; @@ -350,82 +350,196 @@ cg_location(struct m_ext2fs *fs, int number) fs->e2fs->e2fs_first_dblock); } +static int +ext2_cg_validate(struct m_ext2fs *fs) +{ + uint64_t b_bitmap; + uint64_t i_bitmap; + uint64_t i_tables; + uint64_t first_block, last_block, last_cg_block; + struct ext2_gd *gd; + unsigned int i, cg_count; + + first_block = fs->e2fs->e2fs_first_dblock; + last_cg_block = ext2_cg_number_gdb(fs, 0); + cg_count = fs->e2fs_gcount; + + for (i = 0; i < fs->e2fs_gcount; i++) { + gd = &fs->e2fs_gd[i]; + + if (EXT2_HAS_INCOMPAT_FEATURE(fs, EXT2F_INCOMPAT_FLEX_BG) || + i == fs->e2fs_gcount - 1) { + last_block = fs->e2fs_bcount - 1; + } else { + last_block = first_block + + (EXT2_BLOCKS_PER_GROUP(fs) - 1); + } + + if ((cg_count == fs->e2fs_gcount) && + !(gd->ext4bgd_flags & EXT2_BG_INODE_ZEROED)) + cg_count = i; + + b_bitmap = e2fs_gd_get_b_bitmap(gd); + if (b_bitmap == 0) { + printf("ext2fs: cg %u: block bitmap is zero\n", i); + return (EINVAL); + + } + if (b_bitmap <= last_cg_block) { + printf("ext2fs: cg %u: block bitmap overlaps gds\n", i); + return (EINVAL); + } + if (b_bitmap < first_block || b_bitmap > last_block) { + printf("ext2fs: cg %u: block bitmap not in group, blk=%ju\n", + i, b_bitmap); + return (EINVAL); + } + + i_bitmap = e2fs_gd_get_i_bitmap(gd); + if (i_bitmap == 0) { + printf("ext2fs: cg %u: inode bitmap is zero\n", i); + return (EINVAL); + } + if (i_bitmap <= last_cg_block) { + printf("ext2fs: cg %u: inode bitmap overlaps gds\n", i); + return (EINVAL); + } + if (i_bitmap < first_block || i_bitmap > last_block) { + printf("ext2fs: cg %u: inode bitmap not in group blk=%ju\n", + i, i_bitmap); + return (EINVAL); + } + + i_tables = e2fs_gd_get_i_tables(gd); + if (i_tables == 0) { + printf("ext2fs: cg %u: inode table is zero\n", i); + return (EINVAL); + } + if (i_tables <= last_cg_block) { + printf("ext2fs: cg %u: inode talbes overlaps gds\n", i); + return (EINVAL); + } + if (i_tables < first_block || + i_tables + fs->e2fs_itpg - 1 > last_block) { + printf("ext2fs: cg %u: inode tables not in group blk=%ju\n", + i, i_tables); + return (EINVAL); + } + + if (!EXT2_HAS_INCOMPAT_FEATURE(fs, EXT2F_INCOMPAT_FLEX_BG)) + first_block += EXT2_BLOCKS_PER_GROUP(fs); + } + + return (0); +} + /* * This computes the fields of the m_ext2fs structure from the * data in the ext2fs structure read in. */ static int -compute_sb_data(struct vnode *devvp, struct ext2fs *es, +ext2_compute_sb_data(struct vnode *devvp, struct ext2fs *es, struct m_ext2fs *fs) { - int g_count = 0, error; - int i, j; struct buf *bp; uint32_t e2fs_descpb, e2fs_gdbcount_alloc; + int i, j; + int g_count = 0; + int error; - fs->e2fs_bcount = es->e2fs_bcount; - fs->e2fs_rbcount = es->e2fs_rbcount; - fs->e2fs_fbcount = es->e2fs_fbcount; - if (EXT2_HAS_INCOMPAT_FEATURE(fs, EXT2F_INCOMPAT_64BIT)) { - fs->e2fs_bcount |= (uint64_t)(es->e4fs_bcount_hi) << 32; - fs->e2fs_rbcount |= (uint64_t)(es->e4fs_rbcount_hi) << 32; - fs->e2fs_fbcount |= (uint64_t)(es->e4fs_fbcount_hi) << 32; + /* Check checksum features */ + if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_GDT_CSUM) && + EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) { + printf("ext2fs: incorrect checksum features combination\n"); + return (EINVAL); } + + /* Precompute checksum seed for all metadata */ + ext2_sb_csum_set_seed(fs); + + /* Verify sb csum if possible */ + if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) { + error = ext2_sb_csum_verify(fs); + if (error) { + return (error); + } + } + + /* Check for block size = 1K|2K|4K */ + if (es->e2fs_log_bsize > 2) { + printf("ext2fs: bad block size: %d\n", es->e2fs_log_bsize); + return (EINVAL); + } + fs->e2fs_bshift = EXT2_MIN_BLOCK_LOG_SIZE + es->e2fs_log_bsize; fs->e2fs_bsize = 1U << fs->e2fs_bshift; fs->e2fs_fsbtodb = es->e2fs_log_bsize + 1; fs->e2fs_qbmask = fs->e2fs_bsize - 1; + + /* Check for fragment size */ + if (es->e2fs_log_fsize > + (EXT2_MAX_FRAG_LOG_SIZE - EXT2_MIN_BLOCK_LOG_SIZE)) { + printf("ext2fs: invalid log cluster size: %u\n", + es->e2fs_log_fsize); + return (EINVAL); + } + fs->e2fs_fsize = EXT2_MIN_FRAG_SIZE << es->e2fs_log_fsize; - if (fs->e2fs_fsize) - fs->e2fs_fpb = fs->e2fs_bsize / fs->e2fs_fsize; - fs->e2fs_bpg = es->e2fs_bpg; - fs->e2fs_fpg = es->e2fs_fpg; - fs->e2fs_ipg = es->e2fs_ipg; + if (fs->e2fs_fsize != fs->e2fs_bsize) { + printf("ext2fs: fragment size (%u) != block size %u\n", + fs->e2fs_fsize, fs->e2fs_bsize); + return (EINVAL); + } + + fs->e2fs_fpb = fs->e2fs_bsize / fs->e2fs_fsize; + + /* Check reserved gdt blocks for future filesystem expansion */ + if (es->e2fs_reserved_ngdb > (fs->e2fs_bsize / 4)) { + printf("ext2fs: number of reserved GDT blocks too large: %u\n", + es->e2fs_reserved_ngdb); + return (EINVAL); + } + if (es->e2fs_rev == E2FS_REV0) { fs->e2fs_isize = E2FS_REV0_INODE_SIZE; } else { fs->e2fs_isize = es->e2fs_inode_size; /* + * Check first ino. + */ + if (es->e2fs_first_ino < EXT2_FIRSTINO) { + printf("ext2fs: invalid first ino: %u\n", + es->e2fs_first_ino); + return (EINVAL); + } + + /* * Simple sanity check for superblock inode size value. */ if (EXT2_INODE_SIZE(fs) < E2FS_REV0_INODE_SIZE || EXT2_INODE_SIZE(fs) > fs->e2fs_bsize || (fs->e2fs_isize & (fs->e2fs_isize - 1)) != 0) { - printf("ext2fs: invalid inode size %d\n", + printf("ext2fs: invalid inode size %u\n", fs->e2fs_isize); - return (EIO); + return (EINVAL); } } - /* Check for extra isize in big inodes. */ - if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_EXTRA_ISIZE) && - EXT2_INODE_SIZE(fs) < sizeof(struct ext2fs_dinode)) { - printf("ext2fs: no space for extra inode timestamps\n"); - return (EINVAL); - } - /* Check checksum features */ - if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_GDT_CSUM) && - EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) { - printf("ext2fs: incorrect checksum features combination\n"); - return (EINVAL); - } - /* Check for group descriptor size */ + + /* Check group descriptors */ if (EXT2_HAS_INCOMPAT_FEATURE(fs, EXT2F_INCOMPAT_64BIT) && - (es->e3fs_desc_size != sizeof(struct ext2_gd))) { - printf("ext2fs: group descriptor size unsupported %d\n", - es->e3fs_desc_size); - return (EINVAL); + es->e3fs_desc_size != E2FS_64BIT_GD_SIZE) { + printf("ext2fs: unsupported 64bit descriptor size %u\n", + es->e3fs_desc_size); + return (EINVAL); } - /* Check for block size = 1K|2K|4K */ - if (es->e2fs_log_bsize > 2) { - printf("ext2fs: bad block size: %d\n", es->e2fs_log_bsize); + + fs->e2fs_bpg = es->e2fs_bpg; + fs->e2fs_fpg = es->e2fs_fpg; + if (fs->e2fs_bpg == 0 || fs->e2fs_fpg == 0) { + printf("ext2fs: zero blocks/fragments per group\n"); return (EINVAL); } - /* Check for group size */ - if (fs->e2fs_bpg == 0) { - printf("ext2fs: zero blocks per group\n"); - return (EINVAL); - } if (fs->e2fs_bpg != fs->e2fs_bsize * 8) { printf("ext2fs: non-standard group size unsupported %d\n", fs->e2fs_bpg); @@ -433,26 +547,56 @@ compute_sb_data(struct vnode *devvp, struct ext2fs *es } fs->e2fs_ipb = fs->e2fs_bsize / EXT2_INODE_SIZE(fs); - if (fs->e2fs_ipg == 0) { - printf("ext2fs: zero inodes per group\n"); + if (fs->e2fs_ipb == 0 || + fs->e2fs_ipb > fs->e2fs_bsize / E2FS_REV0_INODE_SIZE) { + printf("ext2fs: bad inodes per block size\n"); return (EINVAL); } - fs->e2fs_itpg = fs->e2fs_ipg / fs->e2fs_ipb; - /* Check for block consistency */ - if (es->e2fs_first_dblock >= fs->e2fs_bcount) { - printf("ext2fs: invalid first data block\n"); + + fs->e2fs_ipg = es->e2fs_ipg; + if (fs->e2fs_ipg < fs->e2fs_ipb || fs->e2fs_ipg > fs->e2fs_bsize * 8) { + printf("ext2fs: invalid inodes per group: %u\n", fs->e2fs_ipb); return (EINVAL); } + + fs->e2fs_itpg = fs->e2fs_ipg / fs->e2fs_ipb; + + fs->e2fs_bcount = es->e2fs_bcount; + fs->e2fs_rbcount = es->e2fs_rbcount; + fs->e2fs_fbcount = es->e2fs_fbcount; + if (EXT2_HAS_INCOMPAT_FEATURE(fs, EXT2F_INCOMPAT_64BIT)) { + fs->e2fs_bcount |= (uint64_t)(es->e4fs_bcount_hi) << 32; + fs->e2fs_rbcount |= (uint64_t)(es->e4fs_rbcount_hi) << 32; + fs->e2fs_fbcount |= (uint64_t)(es->e4fs_fbcount_hi) << 32; + } if (fs->e2fs_rbcount > fs->e2fs_bcount || fs->e2fs_fbcount > fs->e2fs_bcount) { printf("ext2fs: invalid block count\n"); return (EINVAL); } - /* s_resuid / s_resgid ? */ + if (es->e2fs_first_dblock >= fs->e2fs_bcount) { + printf("ext2fs: first data block out of range\n"); + return (EINVAL); + } + fs->e2fs_gcount = howmany(fs->e2fs_bcount - es->e2fs_first_dblock, EXT2_BLOCKS_PER_GROUP(fs)); + if (fs->e2fs_gcount > ((uint64_t)1 << 32) - EXT2_DESCS_PER_BLOCK(fs)) { + printf("ext2fs: groups count too large: %u\n", fs->e2fs_gcount); + return (EINVAL); + } + + /* Check for extra isize in big inodes. */ + if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_EXTRA_ISIZE) && + EXT2_INODE_SIZE(fs) < sizeof(struct ext2fs_dinode)) { + printf("ext2fs: no space for extra inode timestamps\n"); + return (EINVAL); + } + + /* s_resuid / s_resgid ? */ + if (EXT2_HAS_INCOMPAT_FEATURE(fs, EXT2F_INCOMPAT_64BIT)) { - e2fs_descpb = fs->e2fs_bsize / sizeof(struct ext2_gd); + e2fs_descpb = fs->e2fs_bsize / E2FS_64BIT_GD_SIZE; e2fs_gdbcount_alloc = howmany(fs->e2fs_gcount, e2fs_descpb); } else { e2fs_descpb = fs->e2fs_bsize / E2FS_REV0_GD_SIZE; @@ -467,7 +611,7 @@ compute_sb_data(struct vnode *devvp, struct ext2fs *es for (i = 0; i < fs->e2fs_gdbcount; i++) { error = bread(devvp, - fsbtodb(fs, cg_location(fs, i)), + fsbtodb(fs, ext2_cg_location(fs, i)), fs->e2fs_bsize, NOCRED, &bp); if (error) { free(fs->e2fs_contigdirs, M_EXT2MNT); @@ -489,9 +633,13 @@ compute_sb_data(struct vnode *devvp, struct ext2fs *es brelse(bp); bp = NULL; } - /* Precompute checksum seed for all metadata */ - ext2_sb_csum_set_seed(fs); - /* Verfy cg csum */ + + /* Validate cgs consistency */ + error = ext2_cg_validate(fs); + if (error) + return (error); + + /* Verfy cgs csum */ if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_GDT_CSUM) || EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) { error = ext2_gd_csum_verify(fs, devvp->v_rdev); @@ -578,7 +726,7 @@ ext2_reload(struct mount *mp, struct thread *td) fs = VFSTOEXT2(mp)->um_e2fs; bcopy(bp->b_data, fs->e2fs, sizeof(struct ext2fs)); - if ((error = compute_sb_data(devvp, es, fs)) != 0) { + if ((error = ext2_compute_sb_data(devvp, es, fs)) != 0) { brelse(bp); return (error); } @@ -715,7 +863,7 @@ ext2_mountfs(struct vnode *devvp, struct mount *mp) M_EXT2MNT, M_WAITOK); mtx_init(EXT2_MTX(ump), "EXT2FS", "EXT2FS Lock", MTX_DEF); bcopy(es, ump->um_e2fs->e2fs, (u_int)sizeof(struct ext2fs)); - if ((error = compute_sb_data(devvp, ump->um_e2fs->e2fs, ump->um_e2fs))) + if ((error = ext2_compute_sb_data(devvp, ump->um_e2fs->e2fs, ump->um_e2fs))) goto out; /* @@ -1204,7 +1352,7 @@ ext2_cgupdate(struct ext2mount *mp, int waitfor) for (i = 0; i < fs->e2fs_gdbcount; i++) { bp = getblk(mp->um_devvp, fsbtodb(fs, - cg_location(fs, i)), + ext2_cg_location(fs, i)), fs->e2fs_bsize, 0, 0, 0); if (EXT2_HAS_INCOMPAT_FEATURE(fs, EXT2F_INCOMPAT_64BIT)) { memcpy(bp->b_data, &fs->e2fs_gd[ Modified: stable/12/sys/fs/ext2fs/ext2fs.h ============================================================================== --- stable/12/sys/fs/ext2fs/ext2fs.h Mon Mar 18 11:44:53 2019 (r345264) +++ stable/12/sys/fs/ext2fs/ext2fs.h Mon Mar 18 12:04:43 2019 (r345265) @@ -395,6 +395,7 @@ struct ext2_gd { }; #define E2FS_REV0_GD_SIZE (sizeof(struct ext2_gd) / 2) +#define E2FS_64BIT_GD_SIZE (sizeof(struct ext2_gd)) /* * Macro-instructions used to manage several block sizes @@ -408,8 +409,8 @@ struct ext2_gd { * Macro-instructions used to manage fragments */ #define EXT2_MIN_FRAG_SIZE 1024 -#define EXT2_MAX_FRAG_SIZE 4096 -#define EXT2_MIN_FRAG_LOG_SIZE 10 +#define EXT2_MIN_FRAG_LOG_SIZE 10 +#define EXT2_MAX_FRAG_LOG_SIZE 30 #define EXT2_FRAG_SIZE(s) (EXT2_SB(s)->e2fs_fsize) #define EXT2_FRAGS_PER_BLOCK(s) (EXT2_SB(s)->e2fs_fpb) From owner-svn-src-stable-12@freebsd.org Mon Mar 18 12:09:11 2019 Return-Path: Delivered-To: svn-src-stable-12@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 B1C06153CC2A; Mon, 18 Mar 2019 12:09:11 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5089786203; Mon, 18 Mar 2019 12:09:11 +0000 (UTC) (envelope-from fsu@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 2A794211A6; Mon, 18 Mar 2019 12:09:11 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2IC9B7W087636; Mon, 18 Mar 2019 12:09:11 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2IC9BJD087635; Mon, 18 Mar 2019 12:09:11 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <201903181209.x2IC9BJD087635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Mon, 18 Mar 2019 12:09:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345266 - stable/12/sys/fs/ext2fs X-SVN-Group: stable-12 X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: stable/12/sys/fs/ext2fs X-SVN-Commit-Revision: 345266 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5089786203 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Mar 2019 12:09:12 -0000 Author: fsu Date: Mon Mar 18 12:09:10 2019 New Revision: 345266 URL: https://svnweb.freebsd.org/changeset/base/345266 Log: MFC: r344753: Validate block bitmaps. Reviewed by: pfg Differential Revision: https://reviews.freebsd.org/D19324 Modified: stable/12/sys/fs/ext2fs/ext2_alloc.c Modified: stable/12/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_alloc.c Mon Mar 18 12:04:43 2019 (r345265) +++ stable/12/sys/fs/ext2fs/ext2_alloc.c Mon Mar 18 12:09:10 2019 (r345266) @@ -902,6 +902,52 @@ ext2_cg_block_bitmap_init(struct m_ext2fs *fs, int cg, return (0); } +static int +ext2_b_bitmap_validate(struct m_ext2fs *fs, struct buf *bp, int cg) +{ + struct ext2_gd *gd; + uint64_t group_first_block; + unsigned int offset, max_bit; + + if (EXT2_HAS_INCOMPAT_FEATURE(fs, EXT2F_INCOMPAT_FLEX_BG)) { + /* + * It is not possible to check block bitmap in case of this feature, + * because the inode and block bitmaps and inode table + * blocks may not be in the group at all. + * So, skip check in this case. + */ + return (0); + } + + gd = &fs->e2fs_gd[cg]; + max_bit = fs->e2fs_fpg; + group_first_block = ((uint64_t)cg) * fs->e2fs->e2fs_fpg + + fs->e2fs->e2fs_first_dblock; + + /* Check block bitmap block number */ + offset = e2fs_gd_get_b_bitmap(gd) - group_first_block; + if (offset >= max_bit || !isset(bp->b_data, offset)) { + printf("ext2fs: bad block bitmap, group %d\n", cg); + return (EINVAL); + } + + /* Check inode bitmap block number */ + offset = e2fs_gd_get_i_bitmap(gd) - group_first_block; + if (offset >= max_bit || !isset(bp->b_data, offset)) { + printf("ext2fs: bad inode bitmap, group %d\n", cg); + return (EINVAL); + } + + /* Check inode table */ + offset = e2fs_gd_get_i_tables(gd) - group_first_block; + if (offset >= max_bit || offset + fs->e2fs_itpg >= max_bit) { + printf("ext2fs: bad inode table, group %d\n", cg); + return (EINVAL); + } + + return (0); +} + /* * Determine whether a block can be allocated. * @@ -922,40 +968,37 @@ ext2_alloccg(struct inode *ip, int cg, daddr_t bpref, ump = ip->i_ump; if (e2fs_gd_get_nbfree(&fs->e2fs_gd[cg]) == 0) return (0); + EXT2_UNLOCK(ump); error = bread(ip->i_devvp, fsbtodb(fs, e2fs_gd_get_b_bitmap(&fs->e2fs_gd[cg])), (int)fs->e2fs_bsize, NOCRED, &bp); - if (error) { - brelse(bp); - EXT2_LOCK(ump); - return (0); - } + if (error) + goto fail; + if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_GDT_CSUM) || EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) { error = ext2_cg_block_bitmap_init(fs, cg, bp); - if (error) { - brelse(bp); - EXT2_LOCK(ump); - return (0); - } + if (error) + goto fail; + ext2_gd_b_bitmap_csum_set(fs, cg, bp); } error = ext2_gd_b_bitmap_csum_verify(fs, cg, bp); - if (error) { - brelse(bp); - EXT2_LOCK(ump); - return (0); - } - if (e2fs_gd_get_nbfree(&fs->e2fs_gd[cg]) == 0) { - /* - * Another thread allocated the last block in this - * group while we were waiting for the buffer. - */ - brelse(bp); - EXT2_LOCK(ump); - return (0); - } + if (error) + goto fail; + + error = ext2_b_bitmap_validate(fs,bp, cg); + if (error) + goto fail; + + /* + * Check, that another thread did not not allocate the last block in this + * group while we were waiting for the buffer. + */ + if (e2fs_gd_get_nbfree(&fs->e2fs_gd[cg]) == 0) + goto fail; + bbp = (char *)bp->b_data; if (dtog(fs, bpref) != cg) @@ -1028,11 +1071,9 @@ retry: goto retry; } bno = ext2_mapsearch(fs, bbp, bpref); - if (bno < 0) { - brelse(bp); - EXT2_LOCK(ump); - return (0); - } + if (bno < 0) + goto fail; + gotit: #ifdef INVARIANTS if (isset(bbp, bno)) { @@ -1052,6 +1093,11 @@ gotit: ext2_gd_b_bitmap_csum_set(fs, cg, bp); bdwrite(bp); return (((uint64_t)cg) * fs->e2fs->e2fs_fpg + fs->e2fs->e2fs_first_dblock + bno); + +fail: + brelse(bp); + EXT2_LOCK(ump); + return (0); } /* From owner-svn-src-stable-12@freebsd.org Mon Mar 18 12:15:59 2019 Return-Path: Delivered-To: svn-src-stable-12@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 2C2A0153CF7F; Mon, 18 Mar 2019 12:15:59 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C362D866BB; Mon, 18 Mar 2019 12:15:58 +0000 (UTC) (envelope-from fsu@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 92E4621361; Mon, 18 Mar 2019 12:15:58 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2ICFwdb092498; Mon, 18 Mar 2019 12:15:58 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2ICFwOL092497; Mon, 18 Mar 2019 12:15:58 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <201903181215.x2ICFwOL092497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Mon, 18 Mar 2019 12:15:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345267 - stable/12/sys/fs/ext2fs X-SVN-Group: stable-12 X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: stable/12/sys/fs/ext2fs X-SVN-Commit-Revision: 345267 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C362D866BB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Mar 2019 12:15:59 -0000 Author: fsu Date: Mon Mar 18 12:15:58 2019 New Revision: 345267 URL: https://svnweb.freebsd.org/changeset/base/345267 Log: MFC: r344755: Fix integer overflow possibility. Reported by: Christopher Krah, Thomas Barabosch, and Jan-Niclas Hilgert of Fraunhofer FKIE Reported as: FS-2-EXT2-1: Out-of-Bounds Write in nmount (ext2_vget) Reviewed by: pfg Differential Revision: https://reviews.freebsd.org/D19326 Modified: stable/12/sys/fs/ext2fs/ext2_vfsops.c Modified: stable/12/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_vfsops.c Mon Mar 18 12:09:10 2019 (r345266) +++ stable/12/sys/fs/ext2fs/ext2_vfsops.c Mon Mar 18 12:15:58 2019 (r345267) @@ -1156,8 +1156,8 @@ ext2_vget(struct mount *mp, ino_t ino, int flags, stru struct buf *bp; struct vnode *vp; struct thread *td; - int i, error; - int used_blocks; + unsigned int i, used_blocks; + int error; td = curthread; error = vfs_hash_get(mp, ino, flags, td, vpp, NULL, NULL); From owner-svn-src-stable-12@freebsd.org Mon Mar 18 12:22:05 2019 Return-Path: Delivered-To: svn-src-stable-12@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 4682D153D263; Mon, 18 Mar 2019 12:22:05 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DB83786A79; Mon, 18 Mar 2019 12:22:04 +0000 (UTC) (envelope-from fsu@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 B6594214D9; Mon, 18 Mar 2019 12:22:04 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2ICM4Kv096603; Mon, 18 Mar 2019 12:22:04 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2ICM45u096602; Mon, 18 Mar 2019 12:22:04 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <201903181222.x2ICM45u096602@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Mon, 18 Mar 2019 12:22:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345268 - stable/12/sys/fs/ext2fs X-SVN-Group: stable-12 X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: stable/12/sys/fs/ext2fs X-SVN-Commit-Revision: 345268 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DB83786A79 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Mar 2019 12:22:05 -0000 Author: fsu Date: Mon Mar 18 12:22:04 2019 New Revision: 345268 URL: https://svnweb.freebsd.org/changeset/base/345268 Log: MFC: r344756, r345179: Do not read the on-disk inode in case of vnode allocation. Reported by: Christopher Krah, Thomas Barabosch, and Jan-Niclas Hilgert of Fraunhofer FKIE Reported as: FS-6-EXT2-4: Denial Of Service in mkdir-0 (ext2_mkdir/vn_rdwr) Reviewed by: pfg Differential Revision: https://reviews.freebsd.org/D19327 Modified: stable/12/sys/fs/ext2fs/ext2_alloc.c Modified: stable/12/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_alloc.c Mon Mar 18 12:15:58 2019 (r345267) +++ stable/12/sys/fs/ext2fs/ext2_alloc.c Mon Mar 18 12:22:04 2019 (r345268) @@ -373,10 +373,12 @@ int ext2_valloc(struct vnode *pvp, int mode, struct ucred *cred, struct vnode **vpp) { struct timespec ts; - struct inode *pip; struct m_ext2fs *fs; - struct inode *ip; struct ext2mount *ump; + struct inode *pip; + struct inode *ip; + struct vnode *vp; + struct thread *td; ino_t ino, ipref; int error, cg; @@ -404,33 +406,63 @@ ext2_valloc(struct vnode *pvp, int mode, struct ucred } ipref = cg * fs->e2fs->e2fs_ipg + 1; ino = (ino_t)ext2_hashalloc(pip, cg, (long)ipref, mode, ext2_nodealloccg); - if (ino == 0) goto noinodes; - error = VFS_VGET(pvp->v_mount, ino, LK_EXCLUSIVE, vpp); + + td = curthread; + error = vfs_hash_get(ump->um_mountp, ino, LK_EXCLUSIVE, td, vpp, NULL, NULL); + if (error || *vpp != NULL) { + return (error); + } + + ip = malloc(sizeof(struct inode), M_EXT2NODE, M_WAITOK | M_ZERO); + if (ip == NULL) { + return (ENOMEM); + } + + /* Allocate a new vnode/inode. */ + if ((error = getnewvnode("ext2fs", ump->um_mountp, &ext2_vnodeops, &vp)) != 0) { + free(ip, M_EXT2NODE); + return (error); + } + + lockmgr(vp->v_vnlock, LK_EXCLUSIVE, NULL); + vp->v_data = ip; + ip->i_vnode = vp; + ip->i_e2fs = fs = ump->um_e2fs; + ip->i_ump = ump; + ip->i_number = ino; + ip->i_block_group = ino_to_cg(fs, ino); + ip->i_next_alloc_block = 0; + ip->i_next_alloc_goal = 0; + + error = insmntque(vp, ump->um_mountp); if (error) { - ext2_vfree(pvp, ino, mode); + free(ip, M_EXT2NODE); return (error); } - ip = VTOI(*vpp); - /* - * The question is whether using VGET was such good idea at all: - * Linux doesn't read the old inode in when it is allocating a - * new one. I will set at least i_size and i_blocks to zero. - */ - ip->i_flag = 0; - ip->i_size = 0; - ip->i_blocks = 0; - ip->i_mode = 0; - ip->i_flags = 0; + error = vfs_hash_insert(vp, ino, LK_EXCLUSIVE, td, vpp, NULL, NULL); + if (error || *vpp != NULL) { + *vpp = NULL; + free(ip, M_EXT2NODE); + return (error); + } + + if ((error = ext2_vinit(ump->um_mountp, &ext2_fifoops, &vp)) != 0) { + vput(vp); + *vpp = NULL; + free(ip, M_EXT2NODE); + return (error); + } + if (EXT2_HAS_INCOMPAT_FEATURE(fs, EXT2F_INCOMPAT_EXTENTS) && (S_ISREG(mode) || S_ISDIR(mode))) ext4_ext_tree_init(ip); else memset(ip->i_data, 0, sizeof(ip->i_data)); - + /* * Set up a new generation number for this inode. * Avoid zero values. @@ -443,10 +475,10 @@ ext2_valloc(struct vnode *pvp, int mode, struct ucred ip->i_birthtime = ts.tv_sec; ip->i_birthnsec = ts.tv_nsec; -/* -printf("ext2_valloc: allocated inode %d\n", ino); -*/ + *vpp = vp; + return (0); + noinodes: EXT2_UNLOCK(ump); ext2_fserr(fs, cred->cr_uid, "out of inodes"); From owner-svn-src-stable-12@freebsd.org Mon Mar 18 12:26:26 2019 Return-Path: Delivered-To: svn-src-stable-12@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 28D80153D5B8; Mon, 18 Mar 2019 12:26:26 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BCD8686E48; Mon, 18 Mar 2019 12:26:25 +0000 (UTC) (envelope-from fsu@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 9907D21509; Mon, 18 Mar 2019 12:26:25 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2ICQPGF097844; Mon, 18 Mar 2019 12:26:25 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2ICQPN4097843; Mon, 18 Mar 2019 12:26:25 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <201903181226.x2ICQPN4097843@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Mon, 18 Mar 2019 12:26:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345270 - stable/12/sys/fs/ext2fs X-SVN-Group: stable-12 X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: stable/12/sys/fs/ext2fs X-SVN-Commit-Revision: 345270 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BCD8686E48 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.945,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Mar 2019 12:26:26 -0000 Author: fsu Date: Mon Mar 18 12:26:25 2019 New Revision: 345270 URL: https://svnweb.freebsd.org/changeset/base/345270 Log: MFC: r344754: Do not panic if inode bitmap is corrupted. admbug: 804 Reported by: Ilja Van Sprundel Reviewed by: pfg Differential Revision: https://reviews.freebsd.org/D19325 Modified: stable/12/sys/fs/ext2fs/ext2_alloc.c Modified: stable/12/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_alloc.c Mon Mar 18 12:22:23 2019 (r345269) +++ stable/12/sys/fs/ext2fs/ext2_alloc.c Mon Mar 18 12:26:25 2019 (r345270) @@ -1350,10 +1350,12 @@ ext2_nodealloccg(struct inode *ip, int cg, daddr_t ipr start = 0; loc = memcchr(&ibp[start], 0xff, len); if (loc == NULL) { - printf("cg = %d, ipref = %lld, fs = %s\n", + printf("ext2fs: inode bitmap corrupted: " + "cg = %d, ipref = %lld, fs = %s - run fsck\n", cg, (long long)ipref, fs->e2fs_fsmnt); - panic("ext2fs_nodealloccg: map corrupted"); - /* NOTREACHED */ + brelse(bp); + EXT2_LOCK(ump); + return (0); } } ipref = (loc - ibp) * NBBY + ffs(~*loc) - 1; From owner-svn-src-stable-12@freebsd.org Mon Mar 18 12:31:09 2019 Return-Path: Delivered-To: svn-src-stable-12@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 98EC6153DAD0; Mon, 18 Mar 2019 12:31:09 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F2C1871D6; Mon, 18 Mar 2019 12:31:09 +0000 (UTC) (envelope-from fsu@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 E514F2163B; Mon, 18 Mar 2019 12:31:08 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2ICV8ng000445; Mon, 18 Mar 2019 12:31:08 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2ICV8xh000441; Mon, 18 Mar 2019 12:31:08 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <201903181231.x2ICV8xh000441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Mon, 18 Mar 2019 12:31:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345271 - stable/12/sys/fs/ext2fs X-SVN-Group: stable-12 X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: stable/12/sys/fs/ext2fs X-SVN-Commit-Revision: 345271 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3F2C1871D6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Mar 2019 12:31:09 -0000 Author: fsu Date: Mon Mar 18 12:31:07 2019 New Revision: 345271 URL: https://svnweb.freebsd.org/changeset/base/345271 Log: MFC: r344752: Add additional on-disk inode checks. Reviewed by: pfg Differential Revision: https://reviews.freebsd.org/D19323 Modified: stable/12/sys/fs/ext2fs/ext2_csum.c stable/12/sys/fs/ext2fs/ext2_inode_cnv.c stable/12/sys/fs/ext2fs/ext2_vfsops.c stable/12/sys/fs/ext2fs/ext2fs.h Modified: stable/12/sys/fs/ext2fs/ext2_csum.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_csum.c Mon Mar 18 12:26:25 2019 (r345270) +++ stable/12/sys/fs/ext2fs/ext2_csum.c Mon Mar 18 12:31:07 2019 (r345271) @@ -629,6 +629,8 @@ ext2_ei_csum_verify(struct inode *ip, struct ext2fs_di if (!memcmp(ei, &ei_zero, sizeof(struct ext2fs_dinode))) return (0); + printf("WARNING: Bad inode %ju csum - run fsck\n", ip->i_number); + return (EIO); } Modified: stable/12/sys/fs/ext2fs/ext2_inode_cnv.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_inode_cnv.c Mon Mar 18 12:26:25 2019 (r345270) +++ stable/12/sys/fs/ext2fs/ext2_inode_cnv.c Mon Mar 18 12:31:07 2019 (r345271) @@ -34,7 +34,6 @@ #include #include -#include #include #include #include @@ -92,8 +91,31 @@ ext2_print_inode(struct inode *in) int ext2_ei2i(struct ext2fs_dinode *ei, struct inode *ip) { + struct m_ext2fs *fs = ip->i_e2fs; + if ((ip->i_number < EXT2_FIRST_INO(fs) && ip->i_number != EXT2_ROOTINO) || + (ip->i_number < EXT2_ROOTINO) || + (ip->i_number > fs->e2fs->e2fs_icount)) { + printf("ext2fs: bad inode number %ju\n", ip->i_number); + return (EINVAL); + } + + if (ip->i_number == EXT2_ROOTINO && ei->e2di_nlink == 0) { + printf("ext2fs: root inode unallocated\n"); + return (EINVAL); + } ip->i_nlink = ei->e2di_nlink; + + /* Check extra inode size */ + if (EXT2_INODE_SIZE(fs) > E2FS_REV0_INODE_SIZE) { + if (E2FS_REV0_INODE_SIZE + ei->e2di_extra_isize > + EXT2_INODE_SIZE(fs) || (ei->e2di_extra_isize & 3)) { + printf("ext2fs: bad extra inode size %u, inode size=%u\n", + ei->e2di_extra_isize, EXT2_INODE_SIZE(fs)); + return (EINVAL); + } + } + /* * Godmar thinks - if the link count is zero, then the inode is * unused - according to ext2 standards. Ufs marks this fact by Modified: stable/12/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_vfsops.c Mon Mar 18 12:26:25 2019 (r345270) +++ stable/12/sys/fs/ext2fs/ext2_vfsops.c Mon Mar 18 12:31:07 2019 (r345271) @@ -773,11 +773,18 @@ loop: MNT_VNODE_FOREACH_ALL_ABORT(mp, mvp); return (error); } - ext2_ei2i((struct ext2fs_dinode *)((char *)bp->b_data + + + error = ext2_ei2i((struct ext2fs_dinode *)((char *)bp->b_data + EXT2_INODE_SIZE(fs) * ino_to_fsbo(fs, ip->i_number)), ip); + brelse(bp); VOP_UNLOCK(vp, 0); vrele(vp); + + if (error) { + MNT_VNODE_FOREACH_ALL_ABORT(mp, mvp); + return (error); + } } return (0); } @@ -1208,8 +1215,6 @@ ext2_vget(struct mount *mp, ino_t ino, int flags, stru error = ext2_ei2i((struct ext2fs_dinode *)((char *)bp->b_data + EXT2_INODE_SIZE(fs) * ino_to_fsbo(fs, ino)), ip); if (error) { - printf("ext2fs: Bad inode %lu csum - run fsck\n", - (unsigned long)ino); brelse(bp); vput(vp); *vpp = NULL; Modified: stable/12/sys/fs/ext2fs/ext2fs.h ============================================================================== --- stable/12/sys/fs/ext2fs/ext2fs.h Mon Mar 18 12:26:25 2019 (r345270) +++ stable/12/sys/fs/ext2fs/ext2fs.h Mon Mar 18 12:31:07 2019 (r345271) @@ -422,4 +422,11 @@ struct ext2_gd { EXT2F_INCOMPAT_64BIT) ? ((s)->e2fs_bsize / sizeof(struct ext2_gd)) : \ ((s)->e2fs_bsize / E2FS_REV0_GD_SIZE)) +/* + * Macro-instructions used to manage inodes + */ +#define EXT2_FIRST_INO(s) ((EXT2_SB(s)->e2fs->e2fs_rev == E2FS_REV0) ? \ + EXT2_FIRSTINO : \ + EXT2_SB(s)->e2fs->e2fs_first_ino) + #endif /* !_FS_EXT2FS_EXT2FS_H_ */ From owner-svn-src-stable-12@freebsd.org Mon Mar 18 12:34:14 2019 Return-Path: Delivered-To: svn-src-stable-12@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 CDB51153DFEF; Mon, 18 Mar 2019 12:34:14 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 74DD68777B; Mon, 18 Mar 2019 12:34:14 +0000 (UTC) (envelope-from fsu@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 4125A216AD; Mon, 18 Mar 2019 12:34:14 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2ICYE4U003170; Mon, 18 Mar 2019 12:34:14 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2ICYETn003169; Mon, 18 Mar 2019 12:34:14 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <201903181234.x2ICYETn003169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Mon, 18 Mar 2019 12:34:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345272 - stable/12/sys/fs/ext2fs X-SVN-Group: stable-12 X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: stable/12/sys/fs/ext2fs X-SVN-Commit-Revision: 345272 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 74DD68777B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.945,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Mar 2019 12:34:15 -0000 Author: fsu Date: Mon Mar 18 12:34:13 2019 New Revision: 345272 URL: https://svnweb.freebsd.org/changeset/base/345272 Log: MFC: r344757: Fix double free in case of mount error. Reported by: Christopher Krah, Thomas Barabosch, and Jan-Niclas Hilgert of Fraunhofer FKIE Reported as: FS-9-EXT3-2: Denial Of Service in nmount-5 (vm_fault_hold) Reviewed by: pfg Differential Revision: https://reviews.freebsd.org/D19385 Modified: stable/12/sys/fs/ext2fs/ext2_vfsops.c Modified: stable/12/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_vfsops.c Mon Mar 18 12:31:07 2019 (r345271) +++ stable/12/sys/fs/ext2fs/ext2_vfsops.c Mon Mar 18 12:34:13 2019 (r345272) @@ -614,8 +614,12 @@ ext2_compute_sb_data(struct vnode *devvp, struct ext2f fsbtodb(fs, ext2_cg_location(fs, i)), fs->e2fs_bsize, NOCRED, &bp); if (error) { - free(fs->e2fs_contigdirs, M_EXT2MNT); - free(fs->e2fs_gd, M_EXT2MNT); + /* + * fs->e2fs_gd and fs->e2fs_contigdirs + * will be freed later by the caller, + * because this function could be called from + * MNT_UPDATE path. + */ brelse(bp); return (error); } From owner-svn-src-stable-12@freebsd.org Tue Mar 19 00:27:47 2019 Return-Path: Delivered-To: svn-src-stable-12@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 DA4A8152A451; Tue, 19 Mar 2019 00:27:46 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 78C8B85E6A; Tue, 19 Mar 2019 00:27:46 +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 5072B104B; Tue, 19 Mar 2019 00:27:46 +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 x2J0Rkck015290; Tue, 19 Mar 2019 00:27:46 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2J0RkMT015289; Tue, 19 Mar 2019 00:27:46 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201903190027.x2J0RkMT015289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Tue, 19 Mar 2019 00:27:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345285 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 345285 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 78C8B85E6A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Mar 2019 00:27:47 -0000 Author: kp Date: Tue Mar 19 00:27:45 2019 New Revision: 345285 URL: https://svnweb.freebsd.org/changeset/base/345285 Log: MFC r344794: tun: VIMAGE fix for if_tun cloner The if_tun cloner is not virtualised, but if_clone_attach() does use a virtualised list of cloners. The result is that we can't find the if_tun cloner when we try to remove a renamed tun interface. Virtualise the cloner, and move the final cleanup into a sysuninit so that we're sure this happens after all of the vnet_sysuninits Note that we need unit numbers to be system-unique (rather than unique per vnet, as is done by if_clone_simple()). The unit number is used to create the corresponding /dev/tunX device node, and this node must match with the interface. Switch to if_clone_advanced() so that we have control over the unit numbers. Reproduction scenario: jail -c -n foo persist vnet jexec test ifconfig tun create jexec test ifconfig tun0 name wg0 jexec test ifconfig wg0 destroy PR: 235704 Reviewed by: bz, hrs, hselasky Differential Revision: https://reviews.freebsd.org/D19248 Modified: stable/12/sys/net/if_tun.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if_tun.c ============================================================================== --- stable/12/sys/net/if_tun.c Tue Mar 19 00:07:12 2019 (r345284) +++ stable/12/sys/net/if_tun.c Tue Mar 19 00:27:45 2019 (r345285) @@ -41,6 +41,7 @@ #include #include #include +#include #include #include @@ -105,6 +106,7 @@ struct tun_softc { * which is static after setup. */ static struct mtx tunmtx; +static eventhandler_tag tag; static const char tunname[] = "tun"; static MALLOC_DEFINE(M_TUN, tunname, "Tunnel Interface"); static int tundebug = 0; @@ -129,9 +131,12 @@ static int tunoutput(struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *ro); static void tunstart(struct ifnet *); -static int tun_clone_create(struct if_clone *, int, caddr_t); -static void tun_clone_destroy(struct ifnet *); -static struct if_clone *tun_cloner; +static int tun_clone_match(struct if_clone *ifc, const char *name); +static int tun_clone_create(struct if_clone *, char *, size_t, caddr_t); +static int tun_clone_destroy(struct if_clone *, struct ifnet *); +static struct unrhdr *tun_unrhdr; +VNET_DEFINE_STATIC(struct if_clone *, tun_cloner); +#define V_tun_cloner VNET(tun_cloner) static d_open_t tunopen; static d_close_t tunclose; @@ -173,11 +178,35 @@ static struct cdevsw tun_cdevsw = { }; static int -tun_clone_create(struct if_clone *ifc, int unit, caddr_t params) +tun_clone_match(struct if_clone *ifc, const char *name) { + if (strncmp(tunname, name, 3) == 0 && + (name[3] == '\0' || isdigit(name[3]))) + return (1); + + return (0); +} + +static int +tun_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) +{ struct cdev *dev; - int i; + int err, unit, i; + err = ifc_name2unit(name, &unit); + if (err != 0) + return (err); + + if (unit != -1) { + /* If this unit number is still available that/s okay. */ + if (alloc_unr_specific(tun_unrhdr, unit) == -1) + return (EEXIST); + } else { + unit = alloc_unr(tun_unrhdr); + } + + snprintf(name, IFNAMSIZ, "%s%d", tunname, unit); + /* find any existing device, or allocate new unit number */ i = clone_create(&tunclones, &tun_cdevsw, &unit, &dev, 0); if (i) { @@ -252,6 +281,7 @@ tun_destroy(struct tun_softc *tp) dev = tp->tun_dev; bpfdetach(TUN2IFP(tp)); if_detach(TUN2IFP(tp)); + free_unr(tun_unrhdr, TUN2IFP(tp)->if_dunit); if_free(TUN2IFP(tp)); destroy_dev(dev); seldrain(&tp->tun_rsel); @@ -263,8 +293,8 @@ tun_destroy(struct tun_softc *tp) CURVNET_RESTORE(); } -static void -tun_clone_destroy(struct ifnet *ifp) +static int +tun_clone_destroy(struct if_clone *ifc, struct ifnet *ifp) { struct tun_softc *tp = ifp->if_softc; @@ -272,39 +302,64 @@ tun_clone_destroy(struct ifnet *ifp) TAILQ_REMOVE(&tunhead, tp, tun_list); mtx_unlock(&tunmtx); tun_destroy(tp); + + return (0); } +static void +vnet_tun_init(const void *unused __unused) +{ + V_tun_cloner = if_clone_advanced(tunname, 0, tun_clone_match, + tun_clone_create, tun_clone_destroy); +} +VNET_SYSINIT(vnet_tun_init, SI_SUB_PROTO_IF, SI_ORDER_ANY, + vnet_tun_init, NULL); + +static void +vnet_tun_uninit(const void *unused __unused) +{ + if_clone_detach(V_tun_cloner); +} +VNET_SYSUNINIT(vnet_tun_uninit, SI_SUB_PROTO_IF, SI_ORDER_ANY, + vnet_tun_uninit, NULL); + +static void +tun_uninit(const void *unused __unused) +{ + struct tun_softc *tp; + + EVENTHANDLER_DEREGISTER(dev_clone, tag); + drain_dev_clone_events(); + + mtx_lock(&tunmtx); + while ((tp = TAILQ_FIRST(&tunhead)) != NULL) { + TAILQ_REMOVE(&tunhead, tp, tun_list); + mtx_unlock(&tunmtx); + tun_destroy(tp); + mtx_lock(&tunmtx); + } + mtx_unlock(&tunmtx); + delete_unrhdr(tun_unrhdr); + clone_cleanup(&tunclones); + mtx_destroy(&tunmtx); +} +SYSUNINIT(tun_uninit, SI_SUB_PROTO_IF, SI_ORDER_ANY, tun_uninit, NULL); + static int tunmodevent(module_t mod, int type, void *data) { - static eventhandler_tag tag; - struct tun_softc *tp; switch (type) { case MOD_LOAD: mtx_init(&tunmtx, "tunmtx", NULL, MTX_DEF); clone_setup(&tunclones); + tun_unrhdr = new_unrhdr(0, IF_MAXUNIT, &tunmtx); tag = EVENTHANDLER_REGISTER(dev_clone, tunclone, 0, 1000); if (tag == NULL) return (ENOMEM); - tun_cloner = if_clone_simple(tunname, tun_clone_create, - tun_clone_destroy, 0); break; case MOD_UNLOAD: - if_clone_detach(tun_cloner); - EVENTHANDLER_DEREGISTER(dev_clone, tag); - drain_dev_clone_events(); - - mtx_lock(&tunmtx); - while ((tp = TAILQ_FIRST(&tunhead)) != NULL) { - TAILQ_REMOVE(&tunhead, tp, tun_list); - mtx_unlock(&tunmtx); - tun_destroy(tp); - mtx_lock(&tunmtx); - } - mtx_unlock(&tunmtx); - clone_cleanup(&tunclones); - mtx_destroy(&tunmtx); + /* See tun_uninit, so it's done after the vnet_sysuninit() */ break; default: return EOPNOTSUPP; From owner-svn-src-stable-12@freebsd.org Tue Mar 19 00:29:19 2019 Return-Path: Delivered-To: svn-src-stable-12@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 1ECB6152A712; Tue, 19 Mar 2019 00:29: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B73D6861E9; Tue, 19 Mar 2019 00:29: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 94E45104F; Tue, 19 Mar 2019 00:29: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 x2J0TIH6015486; Tue, 19 Mar 2019 00:29:18 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2J0TIow015485; Tue, 19 Mar 2019 00:29:18 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201903190029.x2J0TIow015485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Tue, 19 Mar 2019 00:29:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345287 - stable/12/tests/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/tests/sys/net X-SVN-Commit-Revision: 345287 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B73D6861E9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Mar 2019 00:29:19 -0000 Author: kp Date: Tue Mar 19 00:29:18 2019 New Revision: 345287 URL: https://svnweb.freebsd.org/changeset/base/345287 Log: MFC r344797: tun tests: Test renaming and destroying a tun interface in a vnet jail There was a problem destroying renamed tun interfaces in vnet jails. This was fixed in r344794. Test the previously failing scenario. PR: 235704 Added: stable/12/tests/sys/net/if_tun_test.sh - copied unchanged from r344797, head/tests/sys/net/if_tun_test.sh Modified: stable/12/tests/sys/net/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/net/Makefile ============================================================================== --- stable/12/tests/sys/net/Makefile Tue Mar 19 00:27:48 2019 (r345286) +++ stable/12/tests/sys/net/Makefile Tue Mar 19 00:29:18 2019 (r345287) @@ -7,6 +7,7 @@ BINDIR= ${TESTSDIR} ATF_TESTS_SH+= if_lagg_test ATF_TESTS_SH+= if_clone_test +ATF_TESTS_SH+= if_tun_test # The tests are written to be run in parallel, but doing so leads to random # panics. I think it's because the kernel's list of interfaces isn't properly Copied: stable/12/tests/sys/net/if_tun_test.sh (from r344797, head/tests/sys/net/if_tun_test.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/tests/sys/net/if_tun_test.sh Tue Mar 19 00:29:18 2019 (r345287, copy of r344797, head/tests/sys/net/if_tun_test.sh) @@ -0,0 +1,30 @@ +# $FreeBSD$ + +. $(atf_get_srcdir)/../common/vnet.subr + +atf_test_case "235704" "cleanup" +235704_head() +{ + atf_set descr "Test PR #235704" + atf_set require.user root +} + +235704_body() +{ + vnet_init + vnet_mkjail one + + tun=$(jexec one ifconfig tun create) + jexec one ifconfig ${tun} name foo + atf_check -s exit:0 jexec one ifconfig foo destroy +} + +235704_cleanup() +{ + vnet_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "235704" +} From owner-svn-src-stable-12@freebsd.org Tue Mar 19 17:00:04 2019 Return-Path: Delivered-To: svn-src-stable-12@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 39DE9152ACC9; Tue, 19 Mar 2019 17:00:04 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF7AC8CEC8; Tue, 19 Mar 2019 17:00: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 B84E0C2A6; Tue, 19 Mar 2019 17:00: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 x2JH03Gc036582; Tue, 19 Mar 2019 17:00:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2JH03O9036581; Tue, 19 Mar 2019 17:00:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201903191700.x2JH03O9036581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 19 Mar 2019 17:00:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345300 - stable/12/sys/dev/hwpmc X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/dev/hwpmc X-SVN-Commit-Revision: 345300 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CF7AC8CEC8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Mar 2019 17:00:04 -0000 Author: kib Date: Tue Mar 19 17:00:03 2019 New Revision: 345300 URL: https://svnweb.freebsd.org/changeset/base/345300 Log: MFC r345078: hwpmc/core: Adopt to upcoming Skylake TSX errata. Modified: stable/12/sys/dev/hwpmc/hwpmc_core.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- stable/12/sys/dev/hwpmc/hwpmc_core.c Tue Mar 19 15:42:11 2019 (r345299) +++ stable/12/sys/dev/hwpmc/hwpmc_core.c Tue Mar 19 17:00:03 2019 (r345300) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -103,6 +104,9 @@ static int core_iap_width; static int core_iap_npmc; static int core_iap_wroffset; +static u_int pmc_alloc_refs; +static bool pmc_tsx_force_abort_set; + static int core_pcpu_noop(struct pmc_mdep *md, int cpu) { @@ -216,6 +220,15 @@ iaf_reload_count_to_perfctr_value(pmc_value_t rlc) return (1ULL << core_iaf_width) - rlc; } +static void +tweak_tsx_force_abort(void *arg) +{ + u_int val; + + val = (uintptr_t)arg; + wrmsr(MSR_TSX_FORCE_ABORT, val); +} + static int iaf_allocate_pmc(int cpu, int ri, struct pmc *pm, const struct pmc_op_pmcallocate *a) @@ -253,6 +266,12 @@ iaf_allocate_pmc(int cpu, int ri, struct pmc *pm, if (ev == 0x0 && umask == 0x3 && ri != 2) return (EINVAL); + pmc_alloc_refs++; + if ((cpu_stdext_feature3 & CPUID_STDEXT3_TSXFA) != 0 && + !pmc_tsx_force_abort_set) { + pmc_tsx_force_abort_set = true; + smp_rendezvous(NULL, tweak_tsx_force_abort, NULL, (void *)1); + } flags = 0; if (config & IAP_OS) @@ -388,6 +407,12 @@ iaf_release_pmc(int cpu, int ri, struct pmc *pmc) KASSERT(core_pcpu[cpu]->pc_corepmcs[ri + core_iaf_ri].phw_pmc == NULL, ("[core,%d] PHW pmc non-NULL", __LINE__)); + + MPASS(pmc_alloc_refs > 0); + if (pmc_alloc_refs-- == 1 && pmc_tsx_force_abort_set) { + pmc_tsx_force_abort_set = false; + smp_rendezvous(NULL, tweak_tsx_force_abort, NULL, (void *)0); + } return (0); } From owner-svn-src-stable-12@freebsd.org Tue Mar 19 17:16:49 2019 Return-Path: Delivered-To: svn-src-stable-12@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 C29EB152C426; Tue, 19 Mar 2019 17:16:48 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 611538D833; Tue, 19 Mar 2019 17:16:48 +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 388F0C61A; Tue, 19 Mar 2019 17:16:48 +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 x2JHGmJq047590; Tue, 19 Mar 2019 17:16:48 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2JHGc9N047534; Tue, 19 Mar 2019 17:16:38 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201903191716.x2JHGc9N047534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 19 Mar 2019 17:16:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345301 - in stable/12: share/man/man4 sys/conf sys/contrib/xz-embedded/freebsd sys/dev/xz sys/geom/uzip sys/mips/conf sys/modules sys/modules/geom/geom_uzip sys/modules/xz X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12: share/man/man4 sys/conf sys/contrib/xz-embedded/freebsd sys/dev/xz sys/geom/uzip sys/mips/conf sys/modules sys/modules/geom/geom_uzip sys/modules/xz X-SVN-Commit-Revision: 345301 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 611538D833 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Mar 2019 17:16:49 -0000 Author: kib Date: Tue Mar 19 17:16:37 2019 New Revision: 345301 URL: https://svnweb.freebsd.org/changeset/base/345301 Log: MFC r344479 (by sobomax), r344605: Modularize xz. Added: stable/12/sys/dev/xz/ - copied from r344605, head/sys/dev/xz/ stable/12/sys/modules/xz/ - copied from r344605, head/sys/modules/xz/ Deleted: stable/12/sys/contrib/xz-embedded/freebsd/xz_malloc.c Modified: stable/12/share/man/man4/geom_uzip.4 stable/12/sys/conf/NOTES stable/12/sys/conf/files stable/12/sys/contrib/xz-embedded/freebsd/xz_config.h stable/12/sys/geom/uzip/g_uzip.c stable/12/sys/geom/uzip/g_uzip_lzma.c stable/12/sys/mips/conf/ALFA_HORNET_UB stable/12/sys/mips/conf/AP121 stable/12/sys/mips/conf/AP135 stable/12/sys/mips/conf/AP143 stable/12/sys/mips/conf/AP91 stable/12/sys/mips/conf/AP93 stable/12/sys/mips/conf/AP94 stable/12/sys/mips/conf/AP96 stable/12/sys/mips/conf/BCM stable/12/sys/mips/conf/CARAMBOLA2 stable/12/sys/mips/conf/DB120 stable/12/sys/mips/conf/DIR-655A1 stable/12/sys/mips/conf/DIR-825B1 stable/12/sys/mips/conf/ENH200 stable/12/sys/mips/conf/MT7620A_FDT stable/12/sys/mips/conf/MT7620N_FDT stable/12/sys/mips/conf/MT7621_FDT stable/12/sys/mips/conf/MT7628_FDT stable/12/sys/mips/conf/ONIONOMEGA stable/12/sys/mips/conf/PB47 stable/12/sys/mips/conf/PB92 stable/12/sys/mips/conf/PICOSTATION_M2HP stable/12/sys/mips/conf/ROCKET_M2HP stable/12/sys/mips/conf/ROUTERSTATION stable/12/sys/mips/conf/ROUTERSTATION_MFS stable/12/sys/mips/conf/RSPRO stable/12/sys/mips/conf/RSPRO_MFS stable/12/sys/mips/conf/RSPRO_STANDALONE stable/12/sys/mips/conf/RT3050_FDT stable/12/sys/mips/conf/RT3352_FDT stable/12/sys/mips/conf/RT3883_FDT stable/12/sys/mips/conf/RT5350_FDT stable/12/sys/mips/conf/TL-ARCHERC7V2 stable/12/sys/mips/conf/TL-WDR4300 stable/12/sys/mips/conf/TL-WR1043NDv2 stable/12/sys/mips/conf/TL-WR740Nv4 stable/12/sys/mips/conf/TP-MR3040 stable/12/sys/mips/conf/TP-WN1043ND stable/12/sys/mips/conf/WZR-300HP stable/12/sys/mips/conf/WZR-HPAG300H stable/12/sys/mips/conf/std.XLP stable/12/sys/modules/Makefile stable/12/sys/modules/geom/geom_uzip/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/geom_uzip.4 ============================================================================== --- stable/12/share/man/man4/geom_uzip.4 Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/share/man/man4/geom_uzip.4 Tue Mar 19 17:16:37 2019 (r345301) @@ -36,6 +36,7 @@ To compile this driver into the kernel, place the following line in your kernel configuration file: .Bd -ragged -offset indent +.Cd "device xz" .Cd "options GEOM_UZIP" .Ed .Pp Modified: stable/12/sys/conf/NOTES ============================================================================== --- stable/12/sys/conf/NOTES Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/conf/NOTES Tue Mar 19 17:16:37 2019 (r345301) @@ -3063,3 +3063,5 @@ device n25q # device spigen # Generic access to SPI devices from userland. # Enable legacy /dev/spigenN name aliases for /dev/spigenX.Y devices. options SPIGEN_LEGACY_CDEVNAME # legacy device names for spigen + +device xz # xz_embedded LZMA de-compression library Modified: stable/12/sys/conf/files ============================================================================== --- stable/12/sys/conf/files Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/conf/files Tue Mar 19 17:16:37 2019 (r345301) @@ -637,6 +637,17 @@ contrib/ngatm/netnatm/sig/sig_unimsgcpy.c optional nga compile-with "${NORMAL_C} -I$S/contrib/ngatm" contrib/ngatm/netnatm/sig/sig_verify.c optional ngatm_uni \ compile-with "${NORMAL_C} -I$S/contrib/ngatm" +# xz +dev/xz/xz_mod.c optional xz \ + compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" +contrib/xz-embedded/linux/lib/xz/xz_crc32.c optional xz \ + compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" +contrib/xz-embedded/linux/lib/xz/xz_dec_bcj.c optional xz \ + compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" +contrib/xz-embedded/linux/lib/xz/xz_dec_lzma2.c optional xz \ + compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" +contrib/xz-embedded/linux/lib/xz/xz_dec_stream.c optional xz \ + compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" # Zstd contrib/zstd/lib/freebsd/zstd_kmalloc.c optional zstdio compile-with ${ZSTD_C} contrib/zstd/lib/common/zstd_common.c optional zstdio compile-with ${ZSTD_C} @@ -3718,21 +3729,6 @@ geom/raid3/g_raid3.c optional geom_raid3 geom/raid3/g_raid3_ctl.c optional geom_raid3 geom/shsec/g_shsec.c optional geom_shsec geom/stripe/g_stripe.c optional geom_stripe -contrib/xz-embedded/freebsd/xz_malloc.c \ - optional xz_embedded | geom_uzip \ - compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" -contrib/xz-embedded/linux/lib/xz/xz_crc32.c \ - optional xz_embedded | geom_uzip \ - compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" -contrib/xz-embedded/linux/lib/xz/xz_dec_bcj.c \ - optional xz_embedded | geom_uzip \ - compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" -contrib/xz-embedded/linux/lib/xz/xz_dec_lzma2.c \ - optional xz_embedded | geom_uzip \ - compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" -contrib/xz-embedded/linux/lib/xz/xz_dec_stream.c \ - optional xz_embedded | geom_uzip \ - compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" geom/uzip/g_uzip.c optional geom_uzip geom/uzip/g_uzip_lzma.c optional geom_uzip geom/uzip/g_uzip_wrkthr.c optional geom_uzip Modified: stable/12/sys/contrib/xz-embedded/freebsd/xz_config.h ============================================================================== --- stable/12/sys/contrib/xz-embedded/freebsd/xz_config.h Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/contrib/xz-embedded/freebsd/xz_config.h Tue Mar 19 17:16:37 2019 (r345301) @@ -35,7 +35,6 @@ #include #include "xz_malloc.h" -#define XZ_DEC_SINGLE 1 #define XZ_PREBOOT 1 #undef XZ_EXTERN Modified: stable/12/sys/geom/uzip/g_uzip.c ============================================================================== --- stable/12/sys/geom/uzip/g_uzip.c Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/geom/uzip/g_uzip.c Tue Mar 19 17:16:37 2019 (r345301) @@ -921,5 +921,6 @@ static struct g_class g_uzip_class = { }; DECLARE_GEOM_CLASS(g_uzip_class, g_uzip); +MODULE_DEPEND(g_uzip, xz, 1, 1, 1); MODULE_DEPEND(g_uzip, zlib, 1, 1, 1); MODULE_VERSION(geom_uzip, 0); Modified: stable/12/sys/geom/uzip/g_uzip_lzma.c ============================================================================== --- stable/12/sys/geom/uzip/g_uzip_lzma.c Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/geom/uzip/g_uzip_lzma.c Tue Mar 19 17:16:37 2019 (r345301) @@ -103,7 +103,6 @@ g_uzip_lzma_ctor(uint32_t blksz) struct g_uzip_lzma *lzp; lzp = malloc(sizeof(struct g_uzip_lzma), M_GEOM_UZIP, M_WAITOK); - xz_crc32_init(); lzp->s = xz_dec_init(XZ_SINGLE, 0); if (lzp->s == NULL) { goto e1; Modified: stable/12/sys/mips/conf/ALFA_HORNET_UB ============================================================================== --- stable/12/sys/mips/conf/ALFA_HORNET_UB Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/ALFA_HORNET_UB Tue Mar 19 17:16:37 2019 (r345301) @@ -49,7 +49,7 @@ device arswitch options AR71XX_ENV_UBOOT # uzip - to boot natively from flash -device geom_uzip +device xz options GEOM_UZIP # Used for the static uboot partition map Modified: stable/12/sys/mips/conf/AP121 ============================================================================== --- stable/12/sys/mips/conf/AP121 Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/AP121 Tue Mar 19 17:16:37 2019 (r345301) @@ -43,7 +43,7 @@ device arswitch options AR71XX_ENV_UBOOT # uzip - to boot natively from flash -device geom_uzip +device xz options GEOM_UZIP # Used for the static uboot partition map Modified: stable/12/sys/mips/conf/AP135 ============================================================================== --- stable/12/sys/mips/conf/AP135 Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/AP135 Tue Mar 19 17:16:37 2019 (r345301) @@ -46,7 +46,7 @@ device arswitch options AR71XX_ENV_UBOOT # uzip - to boot natively from flash -device geom_uzip +device xz options GEOM_UZIP # Used for the static uboot partition map Modified: stable/12/sys/mips/conf/AP143 ============================================================================== --- stable/12/sys/mips/conf/AP143 Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/AP143 Tue Mar 19 17:16:37 2019 (r345301) @@ -43,7 +43,7 @@ device arswitch options AR71XX_ENV_UBOOT # uzip - to boot natively from flash -device geom_uzip +device xz options GEOM_UZIP # Used for the static uboot partition map Modified: stable/12/sys/mips/conf/AP91 ============================================================================== --- stable/12/sys/mips/conf/AP91 Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/AP91 Tue Mar 19 17:16:37 2019 (r345301) @@ -38,7 +38,7 @@ options NO_SWAPPING # options MSDOSFS # uncompress - to boot read-only lzma natively from flash -device geom_uzip +device xz options GEOM_UZIP options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\" Modified: stable/12/sys/mips/conf/AP93 ============================================================================== --- stable/12/sys/mips/conf/AP93 Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/AP93 Tue Mar 19 17:16:37 2019 (r345301) @@ -26,7 +26,7 @@ options AR71XX_ENV_UBOOT options MSDOSFS # uncompress - to boot read-only lzma natively from flash -device geom_uzip +device xz options GEOM_UZIP options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\" Modified: stable/12/sys/mips/conf/AP94 ============================================================================== --- stable/12/sys/mips/conf/AP94 Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/AP94 Tue Mar 19 17:16:37 2019 (r345301) @@ -21,7 +21,7 @@ hints "AP94.hints" # GEOM modules device geom_redboot # to get access to the SPI flash partitions -device geom_uzip # compressed in-memory filesystem hackery! +device xz options GEOM_UZIP options ROOTDEVNAME=\"ufs:md0.uzip\" Modified: stable/12/sys/mips/conf/AP96 ============================================================================== --- stable/12/sys/mips/conf/AP96 Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/AP96 Tue Mar 19 17:16:37 2019 (r345301) @@ -27,7 +27,7 @@ options AR71XX_ENV_UBOOT options MSDOSFS # uncompress - to boot read-only lzma natively from flash -device geom_uzip +device xz options GEOM_UZIP options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\" Modified: stable/12/sys/mips/conf/BCM ============================================================================== --- stable/12/sys/mips/conf/BCM Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/BCM Tue Mar 19 17:16:37 2019 (r345301) @@ -39,7 +39,7 @@ options SOFTUPDATES #Enable FFS so options UFS_ACL #Support for access control lists options UFS_DIRHASH #Improve performance on big directories -device geom_uzip +device xz options GEOM_UZIP options GEOM_LABEL # Providers labelization. options ROOTDEVNAME=\"ufs:ufs/FBSD\" # assumes FW built by Modified: stable/12/sys/mips/conf/CARAMBOLA2 ============================================================================== --- stable/12/sys/mips/conf/CARAMBOLA2 Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/CARAMBOLA2 Tue Mar 19 17:16:37 2019 (r345301) @@ -48,7 +48,7 @@ device arswitch options AR71XX_ENV_UBOOT # uzip - to boot natively from flash -device geom_uzip +device xz options GEOM_UZIP # Used for the static uboot partition map Modified: stable/12/sys/mips/conf/DB120 ============================================================================== --- stable/12/sys/mips/conf/DB120 Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/DB120 Tue Mar 19 17:16:37 2019 (r345301) @@ -38,7 +38,7 @@ device arswitch options AR71XX_ENV_UBOOT # uzip - to boot natively from flash -device geom_uzip +device xz options GEOM_UZIP # Used for the static uboot partition map Modified: stable/12/sys/mips/conf/DIR-655A1 ============================================================================== --- stable/12/sys/mips/conf/DIR-655A1 Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/DIR-655A1 Tue Mar 19 17:16:37 2019 (r345301) @@ -41,7 +41,7 @@ device arswitch options AR71XX_ENV_UBOOT # uzip - to boot natively from flash -device geom_uzip +device xz options GEOM_UZIP # Used for the static uboot partition map Modified: stable/12/sys/mips/conf/DIR-825B1 ============================================================================== --- stable/12/sys/mips/conf/DIR-825B1 Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/DIR-825B1 Tue Mar 19 17:16:37 2019 (r345301) @@ -47,7 +47,7 @@ nooptions INET6 # GEOM modules device geom_map # to get access to the SPI flash partitions -device geom_uzip # compressed in-memory filesystem hackery! +device xz options GEOM_UZIP options GEOM_PART_GPT Modified: stable/12/sys/mips/conf/ENH200 ============================================================================== --- stable/12/sys/mips/conf/ENH200 Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/ENH200 Tue Mar 19 17:16:37 2019 (r345301) @@ -26,7 +26,7 @@ options AR71XX_ENV_UBOOT options MSDOSFS # uncompress - to boot read-only lzma natively from flash -device geom_uzip +device xz options GEOM_UZIP options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\" Modified: stable/12/sys/mips/conf/MT7620A_FDT ============================================================================== --- stable/12/sys/mips/conf/MT7620A_FDT Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/MT7620A_FDT Tue Mar 19 17:16:37 2019 (r345301) @@ -26,7 +26,7 @@ makeoptions MODULES_OVERRIDE="" options ROOTDEVNAME=\"ufs:md0.uzip\" # Support geom_uzip(4) compressed disk images -device geom_uzip +device xz options GEOM_UZIP # Support md(4) and md-based rootfs Modified: stable/12/sys/mips/conf/MT7620N_FDT ============================================================================== --- stable/12/sys/mips/conf/MT7620N_FDT Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/MT7620N_FDT Tue Mar 19 17:16:37 2019 (r345301) @@ -26,7 +26,7 @@ makeoptions MODULES_OVERRIDE="" options ROOTDEVNAME=\"ufs:md0.uzip\" # Support geom_uzip(4) compressed disk images -device geom_uzip +device xz options GEOM_UZIP # Support md(4) and md-based rootfs Modified: stable/12/sys/mips/conf/MT7621_FDT ============================================================================== --- stable/12/sys/mips/conf/MT7621_FDT Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/MT7621_FDT Tue Mar 19 17:16:37 2019 (r345301) @@ -26,7 +26,7 @@ makeoptions MODULES_OVERRIDE="" options ROOTDEVNAME=\"ufs:md0.uzip\" # Support geom_uzip(4) compressed disk images -device geom_uzip +device xz options GEOM_UZIP # Support md(4) and md-based rootfs Modified: stable/12/sys/mips/conf/MT7628_FDT ============================================================================== --- stable/12/sys/mips/conf/MT7628_FDT Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/MT7628_FDT Tue Mar 19 17:16:37 2019 (r345301) @@ -27,7 +27,7 @@ makeoptions MODULES_OVERRIDE="" options ROOTDEVNAME=\"ufs:md0.uzip\" # Support geom_uzip(4) compressed disk images -device geom_uzip +device xz options GEOM_UZIP # Support md(4) and md-based rootfs Modified: stable/12/sys/mips/conf/ONIONOMEGA ============================================================================== --- stable/12/sys/mips/conf/ONIONOMEGA Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/ONIONOMEGA Tue Mar 19 17:16:37 2019 (r345301) @@ -45,7 +45,7 @@ device arswitch options AR71XX_ENV_UBOOT # uzip - to boot natively from flash -device geom_uzip +device xz options GEOM_UZIP # Used for the static uboot partition map Modified: stable/12/sys/mips/conf/PB47 ============================================================================== --- stable/12/sys/mips/conf/PB47 Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/PB47 Tue Mar 19 17:16:37 2019 (r345301) @@ -32,7 +32,7 @@ options AR71XX_REALMEM=64*1024*1024 options MSDOSFS # uncompress - to boot read-only lzma natively from flash -device geom_uzip +device xz options GEOM_UZIP # Used for the static uboot partition map Modified: stable/12/sys/mips/conf/PB92 ============================================================================== --- stable/12/sys/mips/conf/PB92 Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/PB92 Tue Mar 19 17:16:37 2019 (r345301) @@ -55,7 +55,7 @@ options FFS #Berkeley Fast #options UFS_DIRHASH #Improve performance on big directories # Support uncompress lzma rootfs -device geom_uzip +device xz options GEOM_UZIP options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\" Modified: stable/12/sys/mips/conf/PICOSTATION_M2HP ============================================================================== --- stable/12/sys/mips/conf/PICOSTATION_M2HP Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/PICOSTATION_M2HP Tue Mar 19 17:16:37 2019 (r345301) @@ -38,7 +38,7 @@ options NO_SWAPPING # options MSDOSFS # uncompress - to boot read-only lzma natively from flash -device geom_uzip +device xz options GEOM_UZIP options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\" Modified: stable/12/sys/mips/conf/ROCKET_M2HP ============================================================================== --- stable/12/sys/mips/conf/ROCKET_M2HP Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/ROCKET_M2HP Tue Mar 19 17:16:37 2019 (r345301) @@ -38,7 +38,7 @@ options NO_SWAPPING # options MSDOSFS # uncompress - to boot read-only lzma natively from flash -device geom_uzip +device xz options GEOM_UZIP options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\" Modified: stable/12/sys/mips/conf/ROUTERSTATION ============================================================================== --- stable/12/sys/mips/conf/ROUTERSTATION Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/ROUTERSTATION Tue Mar 19 17:16:37 2019 (r345301) @@ -14,7 +14,7 @@ hints "ROUTERSTATION.hints" # GEOM modules device geom_redboot # to get access to the SPI flash partitions -device geom_uzip # compressed in-memory filesystem support +device xz options GEOM_UZIP # For DOS Modified: stable/12/sys/mips/conf/ROUTERSTATION_MFS ============================================================================== --- stable/12/sys/mips/conf/ROUTERSTATION_MFS Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/ROUTERSTATION_MFS Tue Mar 19 17:16:37 2019 (r345301) @@ -12,7 +12,7 @@ hints "ROUTERSTATION.hints" # GEOM modules device geom_redboot # to get access to the SPI flash partitions -device geom_uzip # compressed in-memory filesystem hackery! +device xz options GEOM_UZIP options ROOTDEVNAME=\"ufs:md0.uzip\" Modified: stable/12/sys/mips/conf/RSPRO ============================================================================== --- stable/12/sys/mips/conf/RSPRO Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/RSPRO Tue Mar 19 17:16:37 2019 (r345301) @@ -15,7 +15,7 @@ device pcf2123_rtc # GEOM modules device geom_redboot # to get access to the SPI flash partitions -device geom_uzip # compressed in-memory filesystem support +device xz options GEOM_UZIP # For DOS Modified: stable/12/sys/mips/conf/RSPRO_MFS ============================================================================== --- stable/12/sys/mips/conf/RSPRO_MFS Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/RSPRO_MFS Tue Mar 19 17:16:37 2019 (r345301) @@ -15,7 +15,7 @@ device pcf2123_rtc # GEOM modules device geom_redboot # to get access to the SPI flash partitions -device geom_uzip # compressed in-memory filesystem hackery! +device xz options GEOM_UZIP # Boot from the first MFS uzip Modified: stable/12/sys/mips/conf/RSPRO_STANDALONE ============================================================================== --- stable/12/sys/mips/conf/RSPRO_STANDALONE Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/RSPRO_STANDALONE Tue Mar 19 17:16:37 2019 (r345301) @@ -14,7 +14,7 @@ device pcf2123_rtc # GEOM modules device geom_redboot # to get access to the SPI flash partitions -device geom_uzip # compressed in-memory filesystem support +device xz options GEOM_UZIP # For DOS Modified: stable/12/sys/mips/conf/RT3050_FDT ============================================================================== --- stable/12/sys/mips/conf/RT3050_FDT Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/RT3050_FDT Tue Mar 19 17:16:37 2019 (r345301) @@ -27,7 +27,7 @@ makeoptions MODULES_OVERRIDE="" options ROOTDEVNAME=\"ufs:md0.uzip\" # Support geom_uzip(4) compressed disk images -device geom_uzip +device xz options GEOM_UZIP # Support md(4) and md-based rootfs Modified: stable/12/sys/mips/conf/RT3352_FDT ============================================================================== --- stable/12/sys/mips/conf/RT3352_FDT Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/RT3352_FDT Tue Mar 19 17:16:37 2019 (r345301) @@ -26,7 +26,7 @@ makeoptions MODULES_OVERRIDE="" options ROOTDEVNAME=\"ufs:md0.uzip\" # Support geom_uzip(4) compressed disk images -device geom_uzip +device xz options GEOM_UZIP # Support md(4) and md-based rootfs Modified: stable/12/sys/mips/conf/RT3883_FDT ============================================================================== --- stable/12/sys/mips/conf/RT3883_FDT Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/RT3883_FDT Tue Mar 19 17:16:37 2019 (r345301) @@ -27,7 +27,7 @@ makeoptions MODULES_OVERRIDE="" options ROOTDEVNAME=\"ufs:md0.uzip\" # Support geom_uzip(4) compressed disk images -device geom_uzip +device xz options GEOM_UZIP # Support md(4) and md-based rootfs Modified: stable/12/sys/mips/conf/RT5350_FDT ============================================================================== --- stable/12/sys/mips/conf/RT5350_FDT Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/RT5350_FDT Tue Mar 19 17:16:37 2019 (r345301) @@ -26,7 +26,7 @@ makeoptions MODULES_OVERRIDE="" options ROOTDEVNAME=\"ufs:md0.uzip\" # Support geom_uzip(4) compressed disk images -device geom_uzip +device xz options GEOM_UZIP # Support md(4) and md-based rootfs Modified: stable/12/sys/mips/conf/TL-ARCHERC7V2 ============================================================================== --- stable/12/sys/mips/conf/TL-ARCHERC7V2 Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/TL-ARCHERC7V2 Tue Mar 19 17:16:37 2019 (r345301) @@ -46,7 +46,7 @@ options MSDOSFS options AR71XX_ENV_UBOOT # uzip - to boot natively from flash -device geom_uzip +device xz options GEOM_UZIP # Used for the static uboot partition map Modified: stable/12/sys/mips/conf/TL-WDR4300 ============================================================================== --- stable/12/sys/mips/conf/TL-WDR4300 Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/TL-WDR4300 Tue Mar 19 17:16:37 2019 (r345301) @@ -39,7 +39,7 @@ options MSDOSFS options AR71XX_ENV_UBOOT # uzip - to boot natively from flash -device geom_uzip +device xz options GEOM_UZIP # Used for the static uboot partition map Modified: stable/12/sys/mips/conf/TL-WR1043NDv2 ============================================================================== --- stable/12/sys/mips/conf/TL-WR1043NDv2 Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/TL-WR1043NDv2 Tue Mar 19 17:16:37 2019 (r345301) @@ -34,7 +34,7 @@ options MSDOSFS options AR71XX_ENV_UBOOT # uzip - to boot natively from flash -device geom_uzip +device xz options GEOM_UZIP # Used for the static uboot partition map Modified: stable/12/sys/mips/conf/TL-WR740Nv4 ============================================================================== --- stable/12/sys/mips/conf/TL-WR740Nv4 Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/TL-WR740Nv4 Tue Mar 19 17:16:37 2019 (r345301) @@ -43,7 +43,7 @@ device arswitch options AR71XX_ENV_UBOOT # uzip - to boot natively from flash -device geom_uzip +device xz options GEOM_UZIP # Used for the static uboot partition map Modified: stable/12/sys/mips/conf/TP-MR3040 ============================================================================== --- stable/12/sys/mips/conf/TP-MR3040 Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/TP-MR3040 Tue Mar 19 17:16:37 2019 (r345301) @@ -48,7 +48,7 @@ device arswitch options AR71XX_ENV_UBOOT # uzip - to boot read-only lzma natively from flash -device geom_uzip +device xz options GEOM_UZIP options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\" Modified: stable/12/sys/mips/conf/TP-WN1043ND ============================================================================== --- stable/12/sys/mips/conf/TP-WN1043ND Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/TP-WN1043ND Tue Mar 19 17:16:37 2019 (r345301) @@ -39,7 +39,7 @@ options MSDOSFS options AR71XX_ENV_UBOOT # uncompress - to boot natively from flash -device geom_uzip +device xz options GEOM_UZIP # Used for the static uboot partition map Modified: stable/12/sys/mips/conf/WZR-300HP ============================================================================== --- stable/12/sys/mips/conf/WZR-300HP Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/WZR-300HP Tue Mar 19 17:16:37 2019 (r345301) @@ -26,7 +26,8 @@ options BOOTVERBOSE # GEOM modules device geom_map # to get access to the SPI flash partitions -device geom_uzip # compressed in-memory filesystem hackery! +device xz +options GEOM_UZIP options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\" Modified: stable/12/sys/mips/conf/WZR-HPAG300H ============================================================================== --- stable/12/sys/mips/conf/WZR-HPAG300H Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/WZR-HPAG300H Tue Mar 19 17:16:37 2019 (r345301) @@ -25,7 +25,8 @@ options AR71XX_ENV_UBOOT options BOOTVERBOSE # GEOM modules -device geom_uzip # compressed in-memory filesystem hackery! +device xz +options GEOM_UZIP device geom_map # to get access to the SPI flash partitions options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\" Modified: stable/12/sys/mips/conf/std.XLP ============================================================================== --- stable/12/sys/mips/conf/std.XLP Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/mips/conf/std.XLP Tue Mar 19 17:16:37 2019 (r345301) @@ -56,6 +56,7 @@ options ALT_BREAK_TO_DEBUGGER #options LOCK_DEBUG #options LOCK_PROFILING +device xz options GEOM_UZIP # Device tree Modified: stable/12/sys/modules/Makefile ============================================================================== --- stable/12/sys/modules/Makefile Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/modules/Makefile Tue Mar 19 17:16:37 2019 (r345301) @@ -418,6 +418,7 @@ SUBDIR= \ ${_x86bios} \ ${_xe} \ xl \ + xz \ zlib .if ${MK_AUTOFS} != "no" || defined(ALL_MODULES) Modified: stable/12/sys/modules/geom/geom_uzip/Makefile ============================================================================== --- stable/12/sys/modules/geom/geom_uzip/Makefile Tue Mar 19 17:00:03 2019 (r345300) +++ stable/12/sys/modules/geom/geom_uzip/Makefile Tue Mar 19 17:16:37 2019 (r345301) @@ -8,16 +8,10 @@ SRCS+= g_uzip.h g_uzip_dapi.h g_uzip_lzma.h g_uzip_zli g_uzip_wrkthr.h #CFLAGS= -g -DINVARIANT_SUPPORT -DINVARIANTS -.PATH: ${SRCTOP}/sys/contrib/xz-embedded/freebsd/ \ - ${SRCTOP}/sys/contrib/xz-embedded/linux/lib/xz/ \ - ${SRCTOP}/sys/contrib/xz-embedded/linux/include/linux/ \ - ${SRCTOP}/sys/net +.PATH: ${SRCTOP}/sys/net CFLAGS+= -I${SRCTOP}/sys/contrib/xz-embedded/freebsd \ -I${SRCTOP}/sys/contrib/xz-embedded/linux/lib/xz/ -SRCS+= xz_crc32.c xz_dec_bcj.c xz_dec_lzma2.c xz_dec_stream.c \ - xz_malloc.c -SRCS+= xz.h xz_config.h xz_lzma2.h xz_malloc.h xz_private.h xz_stream.h SRCS+= opt_geom.h .include From owner-svn-src-stable-12@freebsd.org Tue Mar 19 19:52:34 2019 Return-Path: Delivered-To: svn-src-stable-12@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 4A6091534D1B; Tue, 19 Mar 2019 19:52:34 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E29836CEC6; Tue, 19 Mar 2019 19:52:33 +0000 (UTC) (envelope-from cy@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 A0238E217; Tue, 19 Mar 2019 19:52:33 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2JJqXJl034032; Tue, 19 Mar 2019 19:52:33 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2JJqXUD034030; Tue, 19 Mar 2019 19:52:33 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201903191952.x2JJqXUD034030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 19 Mar 2019 19:52:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345308 - in stable/12: libexec/rc/rc.d tools/build/mk X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable/12: libexec/rc/rc.d tools/build/mk X-SVN-Commit-Revision: 345308 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E29836CEC6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Mar 2019 19:52:34 -0000 Author: cy Date: Tue Mar 19 19:52:32 2019 New Revision: 345308 URL: https://svnweb.freebsd.org/changeset/base/345308 Log: MFC r345079: Fix still installing ipfilter rc.d files even when WITHOUT_IPFILTER is specified. When WITHOUT_IPFILTER is specified, delete-old-files fails to delete the optional rc.d files from above. Fix this. WITHOUT_IPFILTER fails to delete the ipfilter.5 optional file during delete-old-files. Fix this. Reported by: Dmitry Luhtionov Modified: stable/12/libexec/rc/rc.d/Makefile stable/12/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rc/rc.d/Makefile ============================================================================== --- stable/12/libexec/rc/rc.d/Makefile Tue Mar 19 19:11:44 2019 (r345307) +++ stable/12/libexec/rc/rc.d/Makefile Tue Mar 19 19:52:32 2019 (r345308) @@ -46,10 +46,6 @@ CONFS= DAEMON \ hostname \ iovctl \ ip6addrctl \ - ipfilter \ - ipfs \ - ipmon \ - ipnat \ ipsec \ ${_kadmind} \ ${_kdc} \ @@ -213,6 +209,13 @@ HASTPACKAGE= hast .if ${MK_INETD} != "no" CONFS+= inetd +.endif + +.if ${MK_IPFILTER} != "no" +CONFS+= ipfilter \ + ipfs \ + ipmon \ + ipnat .endif .if ${MK_IPFW} != "no" Modified: stable/12/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/12/tools/build/mk/OptionalObsoleteFiles.inc Tue Mar 19 19:11:44 2019 (r345307) +++ stable/12/tools/build/mk/OptionalObsoleteFiles.inc Tue Mar 19 19:52:32 2019 (r345308) @@ -3124,6 +3124,10 @@ OLD_FILES+=usr/share/man/man8/inetd.8.gz .if ${MK_IPFILTER} == no OLD_FILES+=etc/periodic/security/510.ipfdenied OLD_FILES+=etc/periodic/security/610.ipf6denied +OLD_FILES+=etc/rc.d/ipfilter +OLD_FILES+=etc/rc.d/ipfs +OLD_FILES+=etc/rc.d/ipmon +OLD_FILES+=etc/rc.d/ipnat OLD_FILES+=rescue/ipf OLD_FILES+=sbin/ipf OLD_FILES+=sbin/ipfs @@ -3193,6 +3197,7 @@ OLD_FILES+=usr/share/man/man4/ipnat.4.gz OLD_FILES+=usr/share/man/man5/ipf.5.gz OLD_FILES+=usr/share/man/man5/ipf.conf.5.gz OLD_FILES+=usr/share/man/man5/ipf6.conf.5.gz +OLD_FILES+=usr/share/man/man5/ipfilter.5.gz OLD_FILES+=usr/share/man/man5/ipnat.5.gz OLD_FILES+=usr/share/man/man5/ipnat.conf.5.gz OLD_FILES+=usr/share/man/man5/ippool.5.gz From owner-svn-src-stable-12@freebsd.org Wed Mar 20 03:47:13 2019 Return-Path: Delivered-To: svn-src-stable-12@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 7346D1546752; Wed, 20 Mar 2019 03:47:13 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 166A583C0D; Wed, 20 Mar 2019 03:47: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 DEBDD1B35D; Wed, 20 Mar 2019 03:47:12 +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 x2K3lCZn083483; Wed, 20 Mar 2019 03:47:12 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2K3lCjg083482; Wed, 20 Mar 2019 03:47:12 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201903200347.x2K3lCjg083482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 20 Mar 2019 03:47:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345314 - stable/12/lib/libc/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/lib/libc/sys X-SVN-Commit-Revision: 345314 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 166A583C0D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Mar 2019 03:47:13 -0000 Author: emaste Date: Wed Mar 20 03:47:12 2019 New Revision: 345314 URL: https://svnweb.freebsd.org/changeset/base/345314 Log: MFC r345087: Use consistent struct stat arg name in stat man page stat, lstat, and fstat use `*sb` as the stat struct pointer arg name, while fstatat previously used `*buf`. Modified: stable/12/lib/libc/sys/stat.2 Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/sys/stat.2 ============================================================================== --- stable/12/lib/libc/sys/stat.2 Wed Mar 20 01:55:24 2019 (r345313) +++ stable/12/lib/libc/sys/stat.2 Wed Mar 20 03:47:12 2019 (r345314) @@ -48,7 +48,7 @@ .Ft int .Fn fstat "int fd" "struct stat *sb" .Ft int -.Fn fstatat "int fd" "const char *path" "struct stat *buf" "int flag" +.Fn fstatat "int fd" "const char *path" "struct stat *sb" "int flag" .Sh DESCRIPTION The .Fn stat From owner-svn-src-stable-12@freebsd.org Wed Mar 20 10:09:39 2019 Return-Path: Delivered-To: svn-src-stable-12@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 56C87154E7C9; Wed, 20 Mar 2019 10:09:39 +0000 (UTC) (envelope-from gahr@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E8D538EABA; Wed, 20 Mar 2019 10:09:38 +0000 (UTC) (envelope-from gahr@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 C66CE1F334; Wed, 20 Mar 2019 10:09:38 +0000 (UTC) (envelope-from gahr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2KA9cCb083276; Wed, 20 Mar 2019 10:09:38 GMT (envelope-from gahr@FreeBSD.org) Received: (from gahr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2KA9csa083275; Wed, 20 Mar 2019 10:09:38 GMT (envelope-from gahr@FreeBSD.org) Message-Id: <201903201009.x2KA9csa083275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gahr set sender to gahr@FreeBSD.org using -f From: Pietro Cerutti Date: Wed, 20 Mar 2019 10:09:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345320 - stable/12/usr.sbin/freebsd-update X-SVN-Group: stable-12 X-SVN-Commit-Author: gahr X-SVN-Commit-Paths: stable/12/usr.sbin/freebsd-update X-SVN-Commit-Revision: 345320 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E8D538EABA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Mar 2019 10:09:39 -0000 Author: gahr (ports committer) Date: Wed Mar 20 10:09:38 2019 New Revision: 345320 URL: https://svnweb.freebsd.org/changeset/base/345320 Log: MFC r34505: freebsd-update: restore old exit code when no updates are available locally This unbreaks ezjail and iocell, which get into an endless loop trying to figure out how many times "freebsd-update install" needs to be called. PR: 229346 Submitted by: Mike Cole Approved by: bapt Modified: stable/12/usr.sbin/freebsd-update/freebsd-update.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- stable/12/usr.sbin/freebsd-update/freebsd-update.sh Wed Mar 20 10:06:44 2019 (r345319) +++ stable/12/usr.sbin/freebsd-update/freebsd-update.sh Wed Mar 20 10:09:38 2019 (r345320) @@ -818,6 +818,7 @@ install_check_params () { echo "No updates are available to install." if [ $ISFETCHED -eq 0 ]; then echo "Run '$0 fetch' first." + exit 1 fi exit 0 fi From owner-svn-src-stable-12@freebsd.org Wed Mar 20 13:10:48 2019 Return-Path: Delivered-To: svn-src-stable-12@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 07F7E1553EE9; Wed, 20 Mar 2019 13:10:48 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A25AB95E28; Wed, 20 Mar 2019 13:10:47 +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 7F413212EB; Wed, 20 Mar 2019 13:10:47 +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 x2KDAlC0083678; Wed, 20 Mar 2019 13:10:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2KDAlhq083677; Wed, 20 Mar 2019 13:10:47 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201903201310.x2KDAlhq083677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 20 Mar 2019 13:10:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345325 - stable/12/sys/i386/i386 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/i386/i386 X-SVN-Commit-Revision: 345325 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A25AB95E28 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Mar 2019 13:10:48 -0000 Author: kib Date: Wed Mar 20 13:10:47 2019 New Revision: 345325 URL: https://svnweb.freebsd.org/changeset/base/345325 Log: MFC r345246: i386: improve detection of the fast page fault assist. Modified: stable/12/sys/i386/i386/exception.s Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/i386/i386/exception.s ============================================================================== --- stable/12/sys/i386/i386/exception.s Wed Mar 20 13:07:57 2019 (r345324) +++ stable/12/sys/i386/i386/exception.s Wed Mar 20 13:10:47 2019 (r345325) @@ -131,6 +131,10 @@ IDTVEC(prot) pushl $T_PROTFLT jmp irettraps IDTVEC(page) + testl $PSL_VM, TF_EFLAGS-TF_ERR(%esp) + jnz 1f + testb $SEL_RPL_MASK, TF_CS-TF_ERR(%esp) + jnz 1f cmpl $PMAP_TRM_MIN_ADDRESS, TF_EIP-TF_ERR(%esp) jb 1f movl %ebx, %cr3 From owner-svn-src-stable-12@freebsd.org Wed Mar 20 15:34:44 2019 Return-Path: Delivered-To: svn-src-stable-12@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 6FB5015571B5; Wed, 20 Mar 2019 15:34:44 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1266D6C2E7; Wed, 20 Mar 2019 15:34:44 +0000 (UTC) (envelope-from mmacy@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 03A2622B78; Wed, 20 Mar 2019 15:34:44 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2KFYhNY058230; Wed, 20 Mar 2019 15:34:43 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2KFYefP058216; Wed, 20 Mar 2019 15:34:40 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201903201534.x2KFYefP058216@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Wed, 20 Mar 2019 15:34:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345327 - in stable/12: . share/mk stand/efi/boot1 stand/efi/libefi stand/efi/loader stand/i386 stand/i386/loader stand/libsa stand/sparc64 stand/sparc64/loader stand/userboot/userboot ... X-SVN-Group: stable-12 X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in stable/12: . share/mk stand/efi/boot1 stand/efi/libefi stand/efi/loader stand/i386 stand/i386/loader stand/libsa stand/sparc64 stand/sparc64/loader stand/userboot/userboot sys/sys tools/build/optio... X-SVN-Commit-Revision: 345327 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1266D6C2E7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.945,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Mar 2019 15:34:44 -0000 Author: mmacy Date: Wed Mar 20 15:34:40 2019 New Revision: 345327 URL: https://svnweb.freebsd.org/changeset/base/345327 Log: MFC r342793 - selectively disable ZFS without disabling loader Sponsored by: iX Systems Added: stable/12/tools/build/options/WITHOUT_LOADER_ZFS - copied unchanged from r342793, head/tools/build/options/WITHOUT_LOADER_ZFS Modified: stable/12/.gitattributes stable/12/share/mk/src.opts.mk stable/12/stand/efi/boot1/Makefile stable/12/stand/efi/libefi/Makefile stable/12/stand/efi/loader/Makefile stable/12/stand/i386/Makefile stable/12/stand/i386/loader/Makefile stable/12/stand/libsa/Makefile stable/12/stand/sparc64/Makefile stable/12/stand/sparc64/loader/Makefile stable/12/stand/userboot/userboot/Makefile stable/12/sys/sys/param.h stable/12/tools/build/options/WITHOUT_ZFS Directory Properties: stable/12/ (props changed) Modified: stable/12/.gitattributes ============================================================================== --- stable/12/.gitattributes Wed Mar 20 13:13:50 2019 (r345326) +++ stable/12/.gitattributes Wed Mar 20 15:34:40 2019 (r345327) @@ -3,3 +3,4 @@ *.cpp diff=cpp *.hpp diff=cpp *.py diff=python +. svn-properties=svn:keywords=tools/build/options/WITHOUT_LOADER_ZFS Modified: stable/12/share/mk/src.opts.mk ============================================================================== --- stable/12/share/mk/src.opts.mk Wed Mar 20 13:13:50 2019 (r345326) +++ stable/12/share/mk/src.opts.mk Wed Mar 20 15:34:40 2019 (r345327) @@ -187,6 +187,7 @@ __DEFAULT_YES_OPTIONS = \ WIRELESS \ WPA_SUPPLICANT_EAPOL \ ZFS \ + LOADER_ZFS \ ZONEINFO __DEFAULT_NO_OPTIONS = \ @@ -451,6 +452,7 @@ MK_SOURCELESS_UCODE:= no .if ${MK_CDDL} == "no" MK_ZFS:= no +MK_LOADER_ZFS:= no MK_CTF:= no .endif Modified: stable/12/stand/efi/boot1/Makefile ============================================================================== --- stable/12/stand/efi/boot1/Makefile Wed Mar 20 13:13:50 2019 (r345326) +++ stable/12/stand/efi/boot1/Makefile Wed Mar 20 15:34:40 2019 (r345327) @@ -25,7 +25,7 @@ CWARNFLAGS.zfs_module.c += -Wno-unused-function # architecture-specific loader code SRCS= boot1.c self_reloc.c start.S ufs_module.c -.if ${MK_ZFS} != "no" +.if ${MK_LOADER_ZFS} != "no" SRCS+= zfs_module.c CFLAGS.zfs_module.c+= -I${ZFSSRC} CFLAGS.zfs_module.c+= -I${SYSDIR}/cddl/boot/zfs Modified: stable/12/stand/efi/libefi/Makefile ============================================================================== --- stable/12/stand/efi/libefi/Makefile Wed Mar 20 13:13:50 2019 (r345326) +++ stable/12/stand/efi/libefi/Makefile Wed Mar 20 15:34:40 2019 (r345327) @@ -44,7 +44,7 @@ CFLAGS+= -fPIC -mno-red-zone .endif CFLAGS+= -I${EFIINC} CFLAGS+= -I${EFIINCMD} -.if ${MK_ZFS} != "no" +.if ${MK_LOADER_ZFS} != "no" CFLAGS+= -I${ZFSSRC} CFLAGS+= -DEFI_ZFS_BOOT .endif Modified: stable/12/stand/efi/loader/Makefile ============================================================================== --- stable/12/stand/efi/loader/Makefile Wed Mar 20 13:13:50 2019 (r345326) +++ stable/12/stand/efi/loader/Makefile Wed Mar 20 15:34:40 2019 (r345327) @@ -26,7 +26,7 @@ SRCS= autoload.c \ vers.c CFLAGS+= -I${.CURDIR}/../loader -.if ${MK_ZFS} != "no" +.if ${MK_LOADER_ZFS} != "no" CFLAGS+= -I${ZFSSRC} CFLAGS+= -DEFI_ZFS_BOOT HAVE_ZFS= yes Modified: stable/12/stand/i386/Makefile ============================================================================== --- stable/12/stand/i386/Makefile Wed Mar 20 13:13:50 2019 (r345326) +++ stable/12/stand/i386/Makefile Wed Mar 20 15:34:40 2019 (r345327) @@ -20,6 +20,6 @@ SUBDIR.yes+= pxeldr SUBDIR.yes+= kgzldr .endif -SUBDIR.${MK_ZFS}+= zfsboot gptzfsboot +SUBDIR.${MK_LOADER_ZFS}+= zfsboot gptzfsboot .include Modified: stable/12/stand/i386/loader/Makefile ============================================================================== --- stable/12/stand/i386/loader/Makefile Wed Mar 20 13:13:50 2019 (r345326) +++ stable/12/stand/i386/loader/Makefile Wed Mar 20 15:34:40 2019 (r345327) @@ -1,6 +1,6 @@ # $FreeBSD$ -HAVE_ZFS= ${MK_ZFS} +HAVE_ZFS= ${MK_LOADER_ZFS} LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes @@ -64,7 +64,7 @@ ${LOADER}: ${LOADER}.bin ${BTXLDR} ${BTXKERN} ${LOADER}.bin: ${LOADER}.sym strip -R .comment -R .note -o ${.TARGET} ${.ALLSRC} -.if ${MK_ZFS} == "yes" && ${LOADER_INTERP} == ${LOADER_DEFAULT_INTERP} +.if ${MK_LOADER_ZFS} == "yes" && ${LOADER_INTERP} == ${LOADER_DEFAULT_INTERP} LINKS+= ${BINDIR}/${LOADER} ${BINDIR}/zfsloader .endif .if ${LOADER_INTERP} == ${LOADER_DEFAULT_INTERP} Modified: stable/12/stand/libsa/Makefile ============================================================================== --- stable/12/stand/libsa/Makefile Wed Mar 20 13:13:50 2019 (r345326) +++ stable/12/stand/libsa/Makefile Wed Mar 20 15:34:40 2019 (r345327) @@ -165,7 +165,7 @@ SRCS+= explicit_bzero.c .endif # Maybe ZFS -.if ${MK_ZFS} == "yes" +.if ${MK_LOADER_ZFS} == "yes" .include "${SASRC}/zfs/Makefile.inc" .endif Modified: stable/12/stand/sparc64/Makefile ============================================================================== --- stable/12/stand/sparc64/Makefile Wed Mar 20 13:13:50 2019 (r345326) +++ stable/12/stand/sparc64/Makefile Wed Mar 20 15:34:40 2019 (r345327) @@ -5,6 +5,6 @@ NO_OBJ=t .include SUBDIR.yes= boot1 loader -SUBDIR.${MK_ZFS}+=zfsboot +SUBDIR.${MK_LOADER_ZFS}+=zfsboot .include Modified: stable/12/stand/sparc64/loader/Makefile ============================================================================== --- stable/12/stand/sparc64/loader/Makefile Wed Mar 20 13:13:50 2019 (r345326) +++ stable/12/stand/sparc64/loader/Makefile Wed Mar 20 15:34:40 2019 (r345327) @@ -1,6 +1,6 @@ # $FreeBSD$ -HAVE_ZFS= ${MK_ZFS} +HAVE_ZFS= ${MK_LOADER_ZFS} LOADER_DISK_SUPPORT?= yes LOADER_UFS_SUPPORT?= yes @@ -21,7 +21,7 @@ NEWVERSWHAT?= "bootstrap loader" sparc64 VERSION_FILE= ${.CURDIR}/../loader/version INSTALLFLAGS= -b -.if ${MK_ZFS} != "no" +.if ${MK_LOADER_ZFS} != "no" HAVE_ZFS= yes .endif @@ -42,7 +42,7 @@ HELP_FILES= ${.CURDIR}/help.sparc64 LDFLAGS+= -static -.if ${MK_ZFS} == "yes" +.if ${MK_LOADER_ZFS} == "yes" LINKS= ${BINDIR}/loader ${BINDIR}/zfsloader .endif Modified: stable/12/stand/userboot/userboot/Makefile ============================================================================== --- stable/12/stand/userboot/userboot/Makefile Wed Mar 20 13:13:50 2019 (r345326) +++ stable/12/stand/userboot/userboot/Makefile Wed Mar 20 15:34:40 2019 (r345327) @@ -45,7 +45,7 @@ VERSION_FILE= ${.CURDIR}/../userboot/version LINKS+= ${BINDIR}/${SHLIB_NAME} ${BINDIR}/userboot.so .endif -.if ${MK_ZFS} != "no" +.if ${MK_LOADER_ZFS} != "no" CFLAGS+= -DUSERBOOT_ZFS_SUPPORT HAVE_ZFS=yes .endif Modified: stable/12/sys/sys/param.h ============================================================================== --- stable/12/sys/sys/param.h Wed Mar 20 13:13:50 2019 (r345326) +++ stable/12/sys/sys/param.h Wed Mar 20 15:34:40 2019 (r345327) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200504 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200505 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Copied: stable/12/tools/build/options/WITHOUT_LOADER_ZFS (from r342793, head/tools/build/options/WITHOUT_LOADER_ZFS) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/tools/build/options/WITHOUT_LOADER_ZFS Wed Mar 20 15:34:40 2019 (r345327, copy of r342793, head/tools/build/options/WITHOUT_LOADER_ZFS) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to not build ZFS file system boot loader support. Modified: stable/12/tools/build/options/WITHOUT_ZFS ============================================================================== --- stable/12/tools/build/options/WITHOUT_ZFS Wed Mar 20 13:13:50 2019 (r345326) +++ stable/12/tools/build/options/WITHOUT_ZFS Wed Mar 20 15:34:40 2019 (r345327) @@ -1,2 +1,2 @@ .\" $FreeBSD$ -Set to not build ZFS file system. +Set to not build ZFS file system kernel module, libraries, and user commands. From owner-svn-src-stable-12@freebsd.org Wed Mar 20 15:37:41 2019 Return-Path: Delivered-To: svn-src-stable-12@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 1D677155733D; Wed, 20 Mar 2019 15:37:41 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B6AB76C53A; Wed, 20 Mar 2019 15:37:40 +0000 (UTC) (envelope-from mmacy@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 8ACB522B79; Wed, 20 Mar 2019 15:37:40 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2KFbe0J058417; Wed, 20 Mar 2019 15:37:40 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2KFbeOt058416; Wed, 20 Mar 2019 15:37:40 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201903201537.x2KFbeOt058416@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Wed, 20 Mar 2019 15:37:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345328 - stable/12/sys/cddl/boot/zfs X-SVN-Group: stable-12 X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: stable/12/sys/cddl/boot/zfs X-SVN-Commit-Revision: 345328 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B6AB76C53A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.942,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Mar 2019 15:37:41 -0000 Author: mmacy Date: Wed Mar 20 15:37:40 2019 New Revision: 345328 URL: https://svnweb.freebsd.org/changeset/base/345328 Log: MFC r342747 - zfsboot: support newer ZFS versions Sponsored by: iX Systems Modified: stable/12/sys/cddl/boot/zfs/zfsimpl.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/boot/zfs/zfsimpl.h ============================================================================== --- stable/12/sys/cddl/boot/zfs/zfsimpl.h Wed Mar 20 15:34:40 2019 (r345327) +++ stable/12/sys/cddl/boot/zfs/zfsimpl.h Wed Mar 20 15:37:40 2019 (r345328) @@ -1121,6 +1121,8 @@ typedef struct sa_hdr_phys { #define SA_PARENT_OFFSET 40 #define SA_SYMLINK_OFFSET 160 +#define ZIO_OBJSET_MAC_LEN 32 + /* * Intent log header - this on disk structure holds fields to manage * the log. All fields are 64 bit to easily handle cross architectures. @@ -1133,17 +1135,24 @@ typedef struct zil_header { uint64_t zh_pad[5]; } zil_header_t; -#define OBJSET_PHYS_SIZE 2048 +#define OBJSET_PHYS_SIZE_V2 2048 +#define OBJSET_PHYS_SIZE_V3 4096 typedef struct objset_phys { dnode_phys_t os_meta_dnode; zil_header_t os_zil_header; uint64_t os_type; uint64_t os_flags; - char os_pad[OBJSET_PHYS_SIZE - sizeof (dnode_phys_t)*3 - - sizeof (zil_header_t) - sizeof (uint64_t)*2]; + uint8_t os_portable_mac[ZIO_OBJSET_MAC_LEN]; + uint8_t os_local_mac[ZIO_OBJSET_MAC_LEN]; + char os_pad0[OBJSET_PHYS_SIZE_V2 - sizeof (dnode_phys_t)*3 - + sizeof (zil_header_t) - sizeof (uint64_t)*2 - + 2*ZIO_OBJSET_MAC_LEN]; dnode_phys_t os_userused_dnode; dnode_phys_t os_groupused_dnode; + dnode_phys_t os_projectused_dnode; + char os_pad1[OBJSET_PHYS_SIZE_V3 - OBJSET_PHYS_SIZE_V2 - + sizeof (dnode_phys_t)]; } objset_phys_t; typedef struct dsl_dir_phys { From owner-svn-src-stable-12@freebsd.org Thu Mar 21 00:17:44 2019 Return-Path: Delivered-To: svn-src-stable-12@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 C11F1153FFF6; Thu, 21 Mar 2019 00:17:44 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 63B57882AA; Thu, 21 Mar 2019 00:17:44 +0000 (UTC) (envelope-from asomers@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 3CF8E525; Thu, 21 Mar 2019 00:17:44 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2L0HigK038103; Thu, 21 Mar 2019 00:17:44 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2L0Hh0G038100; Thu, 21 Mar 2019 00:17:43 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201903210017.x2L0Hh0G038100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 21 Mar 2019 00:17:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345357 - stable/12/sbin/ifconfig X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12/sbin/ifconfig X-SVN-Commit-Revision: 345357 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 63B57882AA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Mar 2019 00:17:45 -0000 Author: asomers Date: Thu Mar 21 00:17:43 2019 New Revision: 345357 URL: https://svnweb.freebsd.org/changeset/base/345357 Log: MFC r344559: ifconfig: eliminate trailing whitespace Eliminate trailing whitespace on inet, inet6, and groups lines. I think the "list txpower" command will still show some, but I'm not able to test that. PR: 153731 Reported-by: Nikolay Denev Differential Revision: https://reviews.freebsd.org/D19004 Modified: stable/12/sbin/ifconfig/af_inet.c stable/12/sbin/ifconfig/af_inet6.c stable/12/sbin/ifconfig/ifconfig.c stable/12/sbin/ifconfig/ifgroup.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/ifconfig/af_inet.c ============================================================================== --- stable/12/sbin/ifconfig/af_inet.c Thu Mar 21 00:11:43 2019 (r345356) +++ stable/12/sbin/ifconfig/af_inet.c Thu Mar 21 00:17:43 2019 (r345357) @@ -107,16 +107,16 @@ in_status(int s __unused, const struct ifaddrs *ifa) if (cidr == 0) break; } - printf("/%d ", cidr); + printf("/%d", cidr); } else if (f_inet != NULL && strcmp(f_inet, "dotted") == 0) - printf(" netmask %s ", inet_ntoa(sin->sin_addr)); + printf(" netmask %s", inet_ntoa(sin->sin_addr)); else - printf(" netmask 0x%lx ", (unsigned long)ntohl(sin->sin_addr.s_addr)); + printf(" netmask 0x%lx", (unsigned long)ntohl(sin->sin_addr.s_addr)); if (ifa->ifa_flags & IFF_BROADCAST) { sin = (struct sockaddr_in *)ifa->ifa_broadaddr; if (sin != NULL && sin->sin_addr.s_addr != 0) - printf("broadcast %s ", inet_ntoa(sin->sin_addr)); + printf(" broadcast %s", inet_ntoa(sin->sin_addr)); } print_vhid(ifa, " "); Modified: stable/12/sbin/ifconfig/af_inet6.c ============================================================================== --- stable/12/sbin/ifconfig/af_inet6.c Thu Mar 21 00:11:43 2019 (r345356) +++ stable/12/sbin/ifconfig/af_inet6.c Thu Mar 21 00:17:43 2019 (r345357) @@ -247,49 +247,49 @@ in6_status(int s __unused, const struct ifaddrs *ifa) if (sin == NULL) sin = &null_sin; if (f_inet6 != NULL && strcmp(f_inet6, "cidr") == 0) - printf("/%d ", prefix(&sin->sin6_addr, + printf("/%d", prefix(&sin->sin6_addr, sizeof(struct in6_addr))); else - printf(" prefixlen %d ", prefix(&sin->sin6_addr, + printf(" prefixlen %d", prefix(&sin->sin6_addr, sizeof(struct in6_addr))); if ((flags6 & IN6_IFF_ANYCAST) != 0) - printf("anycast "); + printf(" anycast"); if ((flags6 & IN6_IFF_TENTATIVE) != 0) - printf("tentative "); + printf(" tentative"); if ((flags6 & IN6_IFF_DUPLICATED) != 0) - printf("duplicated "); + printf(" duplicated"); if ((flags6 & IN6_IFF_DETACHED) != 0) - printf("detached "); + printf(" detached"); if ((flags6 & IN6_IFF_DEPRECATED) != 0) - printf("deprecated "); + printf(" deprecated"); if ((flags6 & IN6_IFF_AUTOCONF) != 0) - printf("autoconf "); + printf(" autoconf"); if ((flags6 & IN6_IFF_TEMPORARY) != 0) - printf("temporary "); + printf(" temporary"); if ((flags6 & IN6_IFF_PREFER_SOURCE) != 0) - printf("prefer_source "); + printf(" prefer_source"); if (((struct sockaddr_in6 *)(ifa->ifa_addr))->sin6_scope_id) - printf("scopeid 0x%x ", + printf(" scopeid 0x%x", ((struct sockaddr_in6 *)(ifa->ifa_addr))->sin6_scope_id); if (ip6lifetime && (lifetime.ia6t_preferred || lifetime.ia6t_expire)) { - printf("pltime "); + printf(" pltime"); if (lifetime.ia6t_preferred) { - printf("%s ", lifetime.ia6t_preferred < now.tv_sec + printf(" %s", lifetime.ia6t_preferred < now.tv_sec ? "0" : sec2str(lifetime.ia6t_preferred - now.tv_sec)); } else - printf("infty "); + printf(" infty"); - printf("vltime "); + printf(" vltime"); if (lifetime.ia6t_expire) { - printf("%s ", lifetime.ia6t_expire < now.tv_sec + printf(" %s", lifetime.ia6t_expire < now.tv_sec ? "0" : sec2str(lifetime.ia6t_expire - now.tv_sec)); } else - printf("infty "); + printf(" infty"); } print_vhid(ifa, " "); Modified: stable/12/sbin/ifconfig/ifconfig.c ============================================================================== --- stable/12/sbin/ifconfig/ifconfig.c Thu Mar 21 00:11:43 2019 (r345356) +++ stable/12/sbin/ifconfig/ifconfig.c Thu Mar 21 00:17:43 2019 (r345357) @@ -1405,7 +1405,7 @@ print_vhid(const struct ifaddrs *ifa, const char *s) if (ifd->ifi_vhid == 0) return; - printf("vhid %d ", ifd->ifi_vhid); + printf(" vhid %d", ifd->ifi_vhid); } void Modified: stable/12/sbin/ifconfig/ifgroup.c ============================================================================== --- stable/12/sbin/ifconfig/ifgroup.c Thu Mar 21 00:11:43 2019 (r345356) +++ stable/12/sbin/ifconfig/ifgroup.c Thu Mar 21 00:17:43 2019 (r345357) @@ -113,9 +113,9 @@ getifgroups(int s) len -= sizeof(struct ifg_req); if (strcmp(ifg->ifgrq_group, "all")) { if (cnt == 0) - printf("\tgroups: "); + printf("\tgroups:"); cnt++; - printf("%s ", ifg->ifgrq_group); + printf(" %s", ifg->ifgrq_group); } } if (cnt) From owner-svn-src-stable-12@freebsd.org Thu Mar 21 01:16:38 2019 Return-Path: Delivered-To: svn-src-stable-12@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 AAB6A1543C77; Thu, 21 Mar 2019 01:16:38 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E9018B0FF; Thu, 21 Mar 2019 01:16:38 +0000 (UTC) (envelope-from manu@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 EBC5D1122; Thu, 21 Mar 2019 01:16:37 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2L1Gb8X070014; Thu, 21 Mar 2019 01:16:37 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2L1GbiY070013; Thu, 21 Mar 2019 01:16:37 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201903210116.x2L1GbiY070013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 21 Mar 2019 01:16:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345358 - stable/12 X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: stable/12 X-SVN-Commit-Revision: 345358 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4E9018B0FF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Mar 2019 01:16:38 -0000 Author: manu Date: Thu Mar 21 01:16:37 2019 New Revision: 345358 URL: https://svnweb.freebsd.org/changeset/base/345358 Log: MFC r345159: pkgbase: Use uname as ABI_FILE uname is always rebuild on FreeBSD so use this as ABI_FILE for pkg when building pkg for pkgbase. pkg uses uname too as default ABI_FILE as of commit d8bbf980b7f6f424fb7cc672c23ab2dfc82b6599 https://github.com/freebsd/pkg/commit/d8bbf980b7f6f424fb7cc672c23ab2dfc82b6599 Discussed with: bapt Modified: stable/12/Makefile.inc1 Directory Properties: stable/12/ (props changed) Modified: stable/12/Makefile.inc1 ============================================================================== --- stable/12/Makefile.inc1 Thu Mar 21 00:17:43 2019 (r345357) +++ stable/12/Makefile.inc1 Thu Mar 21 01:16:37 2019 (r345358) @@ -1822,11 +1822,11 @@ create-world-package-${pkgname}: .PHONY @if [ "${pkgname}" == "runtime" ]; then \ sed -i '' -e "s/%VCS_REVISION%/${VCS_REVISION}/" ${WSTAGEDIR}/${pkgname}.ucl ; \ fi - ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \ + ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname -o ALLOW_BASE_SHLIBS=yes \ create -M ${WSTAGEDIR}/${pkgname}.ucl \ -p ${WSTAGEDIR}/${pkgname}.plist \ -r ${WSTAGEDIR} \ - -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} + -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/${PKG_VERSION} .endfor _default_flavor= -default From owner-svn-src-stable-12@freebsd.org Thu Mar 21 11:23:17 2019 Return-Path: Delivered-To: svn-src-stable-12@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 8D2A115347C0; Thu, 21 Mar 2019 11:23:17 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A6D2B869A7; Thu, 21 Mar 2019 11:23:16 +0000 (UTC) (envelope-from eugen@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 584258153; Thu, 21 Mar 2019 11:23:16 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2LBNGFX095208; Thu, 21 Mar 2019 11:23:16 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2LBNGKr095207; Thu, 21 Mar 2019 11:23:16 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201903211123.x2LBNGKr095207@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Thu, 21 Mar 2019 11:23:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345374 - stable/12/usr.sbin/trim X-SVN-Group: stable-12 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/12/usr.sbin/trim X-SVN-Commit-Revision: 345374 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A6D2B869A7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Mar 2019 11:23:17 -0000 Author: eugen Date: Thu Mar 21 11:23:15 2019 New Revision: 345374 URL: https://svnweb.freebsd.org/changeset/base/345374 Log: MFC r345130,r345184: trim(8): add another safety net and more user-friendly error message in verbose mode. Modified: stable/12/usr.sbin/trim/trim.c Modified: stable/12/usr.sbin/trim/trim.c ============================================================================== --- stable/12/usr.sbin/trim/trim.c Thu Mar 21 10:51:36 2019 (r345373) +++ stable/12/usr.sbin/trim/trim.c Thu Mar 21 11:23:15 2019 (r345374) @@ -2,7 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2019 Eugene Grosbein . - * All rights reserved. + * Contains code written by Alan Somers . * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -40,12 +40,14 @@ #include #include #include +#include #include #include #include __FBSDID("$FreeBSD$"); +static bool candelete(int fd); static off_t getsize(const char *path); static int opendev(const char *path, int flags); static int trim(const char *path, off_t offset, off_t length, bool dryrun, bool verbose); @@ -104,6 +106,23 @@ main(int argc, char **argv) /* NOTREACHED */ } + /* + * Safety net: do not allow mistakes like + * + * trim -f /dev/da0 -r rfile + * + * This would trim whole device then error on non-existing file -r. + * Following check prevents this while allowing this form still: + * + * trim -f -- /dev/da0 -r rfile + */ + + if (strcmp(argv[optind-1], "--") != 0) { + for (ch = optind; ch < argc; ch++) + if (argv[ch][0] == '-') + usage(name); + } + argv += optind; argc -= optind; @@ -117,6 +136,19 @@ main(int argc, char **argv) return (error ? EXIT_FAILURE : EXIT_SUCCESS); } +static bool +candelete(int fd) +{ + struct diocgattr_arg arg; + + strlcpy(arg.name, "GEOM::candelete", sizeof(arg.name)); + arg.len = sizeof(arg.value.i); + if (ioctl(fd, DIOCGATTR, &arg) == 0) + return (arg.value.i != 0); + else + return (false); +} + static int opendev(const char *path, int flags) { @@ -193,9 +225,12 @@ trim(const char *path, off_t offset, off_t length, boo arg[1] = length; error = ioctl(fd, DIOCGDELETE, arg); - if (error < 0) - warn("ioctl(DIOCGDELETE) failed: %s", path); - + if (error < 0) { + if (errno == EOPNOTSUPP && verbose && !candelete(fd)) + warnx("%s: TRIM/UNMAP not supported by driver", path); + else + warn("ioctl(DIOCGDELETE) failed: %s", path); + } close(fd); return (error); } From owner-svn-src-stable-12@freebsd.org Thu Mar 21 14:17:11 2019 Return-Path: Delivered-To: svn-src-stable-12@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 8C5631541CE2; Thu, 21 Mar 2019 14:17:11 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2972F8D3D5; Thu, 21 Mar 2019 14:17:11 +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 145209EB7; Thu, 21 Mar 2019 14:17:11 +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 x2LEHA2G085924; Thu, 21 Mar 2019 14:17:10 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2LEHAs4085922; Thu, 21 Mar 2019 14:17:10 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201903211417.x2LEHAs4085922@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Thu, 21 Mar 2019 14:17:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345377 - in stable/12: sys/netpfil/pf tests/sys/netpfil/pf X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in stable/12: sys/netpfil/pf tests/sys/netpfil/pf X-SVN-Commit-Revision: 345377 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2972F8D3D5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Mar 2019 14:17:11 -0000 Author: kp Date: Thu Mar 21 14:17:10 2019 New Revision: 345377 URL: https://svnweb.freebsd.org/changeset/base/345377 Log: MFC r345366: pf: Ensure that IP addresses match in ICMP error packets States in pf(4) let ICMP and ICMP6 packets pass if they have a packet in their payload that matches an exiting connection. It was not checked whether the outer ICMP packet has the same destination IP as the source IP of the inner protocol packet. Enforce that these addresses match, to prevent ICMP packets that do not make sense. Reported by: Nicolas Collignon, Corentin Bayet, Eloi Vanderbeken, Luca Moro at Synacktiv Obtained from: OpenBSD Security: CVE-2019-5598 Modified: stable/12/sys/netpfil/pf/pf.c stable/12/tests/sys/netpfil/pf/pft_ping.py Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netpfil/pf/pf.c ============================================================================== --- stable/12/sys/netpfil/pf/pf.c Thu Mar 21 13:30:48 2019 (r345376) +++ stable/12/sys/netpfil/pf/pf.c Thu Mar 21 14:17:10 2019 (r345377) @@ -4596,7 +4596,7 @@ pf_test_state_icmp(struct pf_state **state, int direct { struct pf_addr *saddr = pd->src, *daddr = pd->dst; u_int16_t icmpid = 0, *icmpsum; - u_int8_t icmptype; + u_int8_t icmptype, icmpcode; int state_icmp = 0; struct pf_state_key_cmp key; @@ -4605,6 +4605,7 @@ pf_test_state_icmp(struct pf_state **state, int direct #ifdef INET case IPPROTO_ICMP: icmptype = pd->hdr.icmp->icmp_type; + icmpcode = pd->hdr.icmp->icmp_code; icmpid = pd->hdr.icmp->icmp_id; icmpsum = &pd->hdr.icmp->icmp_cksum; @@ -4619,6 +4620,7 @@ pf_test_state_icmp(struct pf_state **state, int direct #ifdef INET6 case IPPROTO_ICMPV6: icmptype = pd->hdr.icmp6->icmp6_type; + icmpcode = pd->hdr.icmp6->icmp6_code; icmpid = pd->hdr.icmp6->icmp6_id; icmpsum = &pd->hdr.icmp6->icmp6_cksum; @@ -4817,6 +4819,23 @@ pf_test_state_icmp(struct pf_state **state, int direct #endif /* INET6 */ } + if (PF_ANEQ(pd->dst, pd2.src, pd->af)) { + if (V_pf_status.debug >= PF_DEBUG_MISC) { + printf("pf: BAD ICMP %d:%d outer dst: ", + icmptype, icmpcode); + pf_print_host(pd->src, 0, pd->af); + printf(" -> "); + pf_print_host(pd->dst, 0, pd->af); + printf(" inner src: "); + pf_print_host(pd2.src, 0, pd2.af); + printf(" -> "); + pf_print_host(pd2.dst, 0, pd2.af); + printf("\n"); + } + REASON_SET(reason, PFRES_BADSTATE); + return (PF_DROP); + } + switch (pd2.proto) { case IPPROTO_TCP: { struct tcphdr th; @@ -4873,7 +4892,7 @@ pf_test_state_icmp(struct pf_state **state, int direct !SEQ_GEQ(seq, src->seqlo - (dst->max_win << dws)))) { if (V_pf_status.debug >= PF_DEBUG_MISC) { printf("pf: BAD ICMP %d:%d ", - icmptype, pd->hdr.icmp->icmp_code); + icmptype, icmpcode); pf_print_host(pd->src, 0, pd->af); printf(" -> "); pf_print_host(pd->dst, 0, pd->af); @@ -4886,7 +4905,7 @@ pf_test_state_icmp(struct pf_state **state, int direct } else { if (V_pf_status.debug >= PF_DEBUG_MISC) { printf("pf: OK ICMP %d:%d ", - icmptype, pd->hdr.icmp->icmp_code); + icmptype, icmpcode); pf_print_host(pd->src, 0, pd->af); printf(" -> "); pf_print_host(pd->dst, 0, pd->af); Modified: stable/12/tests/sys/netpfil/pf/pft_ping.py ============================================================================== --- stable/12/tests/sys/netpfil/pf/pft_ping.py Thu Mar 21 13:30:48 2019 (r345376) +++ stable/12/tests/sys/netpfil/pf/pft_ping.py Thu Mar 21 14:17:10 2019 (r345377) @@ -8,26 +8,38 @@ import threading PAYLOAD_MAGIC = 0x42c0ffee class Sniffer(threading.Thread): - def __init__(self, recvif): + def __init__(self, args, check_function): threading.Thread.__init__(self) - self._recvif = recvif + self._args = args + self._recvif = args.recvif[0] + self._check_function = check_function + self.foundCorrectPacket = False self.start() + def _checkPacket(self, packet): + ret = self._check_function(self._args, packet) + if ret: + self.foundCorrectPacket = True + return ret + def run(self): - self.packets = sp.sniff(iface=self._recvif, timeout=3) + self.packets = sp.sniff(iface=self._recvif, + stop_filter=self._checkPacket, timeout=3) -def check_ping_request(packet, dst_ip, args): +def check_ping_request(args, packet): if args.ip6: - return check_ping6_request(packet, dst_ip, args) + return check_ping6_request(args, packet) else: - return check_ping4_request(packet, dst_ip, args) + return check_ping4_request(args, packet) -def check_ping4_request(packet, dst_ip, args): +def check_ping4_request(args, packet): """ Verify that the packet matches what we'd have sent """ + dst_ip = args.to[0] + ip = packet.getlayer(sp.IP) if not ip: return False @@ -54,13 +66,14 @@ def check_ping4_request(packet, dst_ip, args): % (ip.tos, args.expect_tos[0]) return False - return True -def check_ping6_request(packet, dst_ip, args): +def check_ping6_request(args, packet): """ Verify that the packet matches what we'd have sent """ + dst_ip = args.to[0] + ip = packet.getlayer(sp.IPv6) if not ip: return False @@ -124,7 +137,7 @@ def main(): sniffer = None if not args.recvif is None: - sniffer = Sniffer(args.recvif[0]) + sniffer = Sniffer(args, check_ping_request) if args.ip6: ping6(args.sendif[0], args.to[0], args) @@ -134,12 +147,10 @@ def main(): if sniffer: sniffer.join() - for packet in sniffer.packets: - if check_ping_request(packet, args.to[0], args): - sys.exit(0) - - # We did not get the packet we expected - sys.exit(1) + if sniffer.foundCorrectPacket: + sys.exit(0) + else: + sys.exit(1) if __name__ == '__main__': main() From owner-svn-src-stable-12@freebsd.org Fri Mar 22 06:02:08 2019 Return-Path: Delivered-To: svn-src-stable-12@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 1B776155BBCD; Fri, 22 Mar 2019 06:02:08 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B284B6BD34; Fri, 22 Mar 2019 06:02:07 +0000 (UTC) (envelope-from bcr@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 732B31C4AA; Fri, 22 Mar 2019 06:02:07 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2M627nr090210; Fri, 22 Mar 2019 06:02:07 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2M6276u090209; Fri, 22 Mar 2019 06:02:07 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <201903220602.x2M6276u090209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Fri, 22 Mar 2019 06:02:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345404 - in stable/12: libexec/rc share/man/man5 X-SVN-Group: stable-12 X-SVN-Commit-Author: bcr X-SVN-Commit-Paths: in stable/12: libexec/rc share/man/man5 X-SVN-Commit-Revision: 345404 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B284B6BD34 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Mar 2019 06:02:08 -0000 Author: bcr (doc committer) Date: Fri Mar 22 06:02:06 2019 New Revision: 345404 URL: https://svnweb.freebsd.org/changeset/base/345404 Log: MFC r345080: Extend descriptions and comments about the need to create /etc/pf.conf. FreeBSD removed the default /etc/pf.conf file in previous releases, but the documentation kept mentioning it like any other file present in the system. Change pf.conf(5) to mention in the description of the default ruleset location that this file needs to be created manually. Also, the default rc.conf file had it's comment extended a bit to let people know that this file does not exist by default. PR: 231977 Submitted by: koobs@ Reviewed by: kp@, 0mp@ Approved by: kp@ Differential Revision: https://reviews.freebsd.org/D19530 Modified: stable/12/libexec/rc/rc.conf stable/12/share/man/man5/pf.conf.5 Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rc/rc.conf ============================================================================== --- stable/12/libexec/rc/rc.conf Fri Mar 22 01:43:55 2019 (r345403) +++ stable/12/libexec/rc/rc.conf Fri Mar 22 06:02:06 2019 (r345404) @@ -208,7 +208,8 @@ ipfs_enable="NO" # Set to YES to enable saving and re ipfs_program="/sbin/ipfs" # where the ipfs program lives ipfs_flags="" # additional flags for ipfs pf_enable="NO" # Set to YES to enable packet filter (pf) -pf_rules="/etc/pf.conf" # rules definition file for pf +pf_rules="/etc/pf.conf" # rules definition file for pf (nonexistent + # by default) pf_program="/sbin/pfctl" # where the pfctl program lives pf_flags="" # additional flags for pfctl pflog_enable="NO" # Set to YES to enable packet filter logging Modified: stable/12/share/man/man5/pf.conf.5 ============================================================================== --- stable/12/share/man/man5/pf.conf.5 Fri Mar 22 01:43:55 2019 (r345403) +++ stable/12/share/man/man5/pf.conf.5 Fri Mar 22 06:02:06 2019 (r345404) @@ -28,7 +28,7 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd January 5, 2019 +.Dd March 10, 2019 .Dt PF.CONF 5 .Os .Sh NAME @@ -3053,6 +3053,8 @@ include = "include" filename Host name database. .It Pa /etc/pf.conf Default location of the ruleset file. +The file has to be created manually as it is not installed with a +standard installation. .It Pa /etc/pf.os Default location of OS fingerprints. .It Pa /etc/protocols From owner-svn-src-stable-12@freebsd.org Fri Mar 22 14:35:16 2019 Return-Path: Delivered-To: svn-src-stable-12@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 AAA061547F53; Fri, 22 Mar 2019 14:35:16 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4703985E9F; Fri, 22 Mar 2019 14:35:16 +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 228F121B1E; Fri, 22 Mar 2019 14:35:16 +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 x2MEZGij060539; Fri, 22 Mar 2019 14:35:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2MEZFqa060537; Fri, 22 Mar 2019 14:35:15 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201903221435.x2MEZFqa060537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 22 Mar 2019 14:35:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345413 - in stable/12/sys: amd64/amd64 i386/i386 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 345413 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4703985E9F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Mar 2019 14:35:16 -0000 Author: kib Date: Fri Mar 22 14:35:15 2019 New Revision: 345413 URL: https://svnweb.freebsd.org/changeset/base/345413 Log: MFC r345190: Provide deterministic (and somewhat useful) value for RDPID result, and for %ecx after RDTSCP. Modified: stable/12/sys/amd64/amd64/initcpu.c stable/12/sys/i386/i386/initcpu.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/initcpu.c ============================================================================== --- stable/12/sys/amd64/amd64/initcpu.c Fri Mar 22 11:46:35 2019 (r345412) +++ stable/12/sys/amd64/amd64/initcpu.c Fri Mar 22 14:35:15 2019 (r345413) @@ -265,6 +265,10 @@ initializecpu(void) init_via(); break; } + + if ((amd_feature & AMDID_RDTSCP) != 0 || + (cpu_stdext_feature2 & CPUID_STDEXT2_RDPID) != 0) + wrmsr(MSR_TSC_AUX, PCPU_GET(cpuid)); } void Modified: stable/12/sys/i386/i386/initcpu.c ============================================================================== --- stable/12/sys/i386/i386/initcpu.c Fri Mar 22 11:46:35 2019 (r345412) +++ stable/12/sys/i386/i386/initcpu.c Fri Mar 22 14:35:15 2019 (r345413) @@ -754,6 +754,9 @@ initializecpu(void) elf32_nxstack = 1; } #endif + if ((amd_feature & AMDID_RDTSCP) != 0 || + (cpu_stdext_feature2 & CPUID_STDEXT2_RDPID) != 0) + wrmsr(MSR_TSC_AUX, PCPU_GET(cpuid)); } void From owner-svn-src-stable-12@freebsd.org Fri Mar 22 23:39:17 2019 Return-Path: Delivered-To: svn-src-stable-12@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 7A8DE1554DFC; Fri, 22 Mar 2019 23:39:17 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 21CDA69A08; Fri, 22 Mar 2019 23:39:17 +0000 (UTC) (envelope-from marcel@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 F0D9927799; Fri, 22 Mar 2019 23:39:16 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2MNdGBb044016; Fri, 22 Mar 2019 23:39:16 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2MNdGRf044015; Fri, 22 Mar 2019 23:39:16 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201903222339.x2MNdGRf044015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Fri, 22 Mar 2019 23:39:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345427 - stable/12/sys/geom/part X-SVN-Group: stable-12 X-SVN-Commit-Author: marcel X-SVN-Commit-Paths: stable/12/sys/geom/part X-SVN-Commit-Revision: 345427 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 21CDA69A08 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Mar 2019 23:39:17 -0000 Author: marcel Date: Fri Mar 22 23:39:16 2019 New Revision: 345427 URL: https://svnweb.freebsd.org/changeset/base/345427 Log: MFC 344790: Revert revision 254095 In revision 254095, gpt_entries is not set to match the on-disk hdr_entries, but rather is computed based on available space. There are 2 problems with this: 1. The GPT backend respects hdr_entries and only reads and writes that number of partition entries. On top of that, CRC32 is computed over the table that has hdr_entries elements. When the common code works on what is possibly a larger number, the behaviour becomes inconsistent and problematic. In particular, it would be possible to add a new partition that on a reboot isn't there anymore. 2. The calculation of gpt_entries is based on flawed assumptions. The GPT specification does not dictate that sectors are layed out in a particular way that the available space can be determined by looking at LBAs. In practice, implementations do the same thing, because there's no reason to do it any other way. Still, GPT allows certain freedoms that can be exploited in some form or shape if the need arises. PR: 229977 Differential Revision: https://reviews.freebsd.org/D19438 Modified: stable/12/sys/geom/part/g_part_gpt.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/geom/part/g_part_gpt.c ============================================================================== --- stable/12/sys/geom/part/g_part_gpt.c Fri Mar 22 22:14:14 2019 (r345426) +++ stable/12/sys/geom/part/g_part_gpt.c Fri Mar 22 23:39:16 2019 (r345427) @@ -990,10 +990,9 @@ g_part_gpt_read(struct g_part_table *basetable, struct basetable->gpt_first = table->hdr->hdr_lba_start; basetable->gpt_last = table->hdr->hdr_lba_end; - basetable->gpt_entries = (table->hdr->hdr_lba_start - 2) * - pp->sectorsize / table->hdr->hdr_entsz; + basetable->gpt_entries = table->hdr->hdr_entries; - for (index = table->hdr->hdr_entries - 1; index >= 0; index--) { + for (index = basetable->gpt_entries - 1; index >= 0; index--) { if (EQUUID(&tbl[index].ent_type, &gpt_uuid_unused)) continue; entry = (struct g_part_gpt_entry *)g_part_new_entry( From owner-svn-src-stable-12@freebsd.org Fri Mar 22 23:55:39 2019 Return-Path: Delivered-To: svn-src-stable-12@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 04EF41555391; Fri, 22 Mar 2019 23:55:39 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9030A6A5CF; Fri, 22 Mar 2019 23:55:38 +0000 (UTC) (envelope-from marcel@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 7F06C27B07; Fri, 22 Mar 2019 23:55:38 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2MNtcZX054553; Fri, 22 Mar 2019 23:55:38 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2MNtZlM054538; Fri, 22 Mar 2019 23:55:35 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201903222355.x2MNtZlM054538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Fri, 22 Mar 2019 23:55:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345428 - in stable/12/usr.bin/mkimg: . tests X-SVN-Group: stable-12 X-SVN-Commit-Author: marcel X-SVN-Commit-Paths: in stable/12/usr.bin/mkimg: . tests X-SVN-Commit-Revision: 345428 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9030A6A5CF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Mar 2019 23:55:39 -0000 Author: marcel Date: Fri Mar 22 23:55:35 2019 New Revision: 345428 URL: https://svnweb.freebsd.org/changeset/base/345428 Log: MFC 344826: Round # partitions up to fill the last GPT table sector Set the number of partitions entries in the GPT header to a multiple of the number of entries that fit in a sector. PR: 236238 Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D19465 Modified: stable/12/usr.bin/mkimg/gpt.c stable/12/usr.bin/mkimg/tests/Makefile stable/12/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow.gz.uu stable/12/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow2.gz.uu stable/12/usr.bin/mkimg/tests/img-1x1-4096-gpt.raw.gz.uu stable/12/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhd.gz.uu stable/12/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhdf.gz.uu stable/12/usr.bin/mkimg/tests/img-1x1-4096-gpt.vmdk.gz.uu stable/12/usr.bin/mkimg/tests/img-1x1-512-gpt.qcow.gz.uu stable/12/usr.bin/mkimg/tests/img-1x1-512-gpt.qcow2.gz.uu stable/12/usr.bin/mkimg/tests/img-1x1-512-gpt.raw.gz.uu stable/12/usr.bin/mkimg/tests/img-1x1-512-gpt.vhd.gz.uu stable/12/usr.bin/mkimg/tests/img-1x1-512-gpt.vhdf.gz.uu stable/12/usr.bin/mkimg/tests/img-1x1-512-gpt.vmdk.gz.uu stable/12/usr.bin/mkimg/tests/img-63x255-4096-gpt.qcow.gz.uu stable/12/usr.bin/mkimg/tests/img-63x255-4096-gpt.qcow2.gz.uu stable/12/usr.bin/mkimg/tests/img-63x255-4096-gpt.raw.gz.uu stable/12/usr.bin/mkimg/tests/img-63x255-4096-gpt.vhd.gz.uu stable/12/usr.bin/mkimg/tests/img-63x255-4096-gpt.vhdf.gz.uu stable/12/usr.bin/mkimg/tests/img-63x255-4096-gpt.vmdk.gz.uu stable/12/usr.bin/mkimg/tests/img-63x255-512-gpt.qcow.gz.uu stable/12/usr.bin/mkimg/tests/img-63x255-512-gpt.qcow2.gz.uu stable/12/usr.bin/mkimg/tests/img-63x255-512-gpt.raw.gz.uu stable/12/usr.bin/mkimg/tests/img-63x255-512-gpt.vhd.gz.uu stable/12/usr.bin/mkimg/tests/img-63x255-512-gpt.vhdf.gz.uu stable/12/usr.bin/mkimg/tests/img-63x255-512-gpt.vmdk.gz.uu Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/mkimg/gpt.c ============================================================================== --- stable/12/usr.bin/mkimg/gpt.c Fri Mar 22 23:39:16 2019 (r345427) +++ stable/12/usr.bin/mkimg/gpt.c Fri Mar 22 23:55:35 2019 (r345428) @@ -259,9 +259,9 @@ gpt_write(lba_t imgsz, void *bootcode) le64enc(&hdr->hdr_lba_end, imgsz - tblsz - 2); mkimg_uuid(&uuid); mkimg_uuid_enc(&hdr->hdr_uuid, &uuid); - le32enc(&hdr->hdr_entries, nparts); + le32enc(&hdr->hdr_entries, tblsz * secsz / sizeof(struct gpt_ent)); le32enc(&hdr->hdr_entsz, sizeof(struct gpt_ent)); - crc = crc32(tbl, nparts * sizeof(struct gpt_ent)); + crc = crc32(tbl, tblsz * secsz); le32enc(&hdr->hdr_crc_table, crc); error = gpt_write_hdr(hdr, 1, imgsz - 1, 2); if (!error) Modified: stable/12/usr.bin/mkimg/tests/Makefile ============================================================================== --- stable/12/usr.bin/mkimg/tests/Makefile Fri Mar 22 23:39:16 2019 (r345427) +++ stable/12/usr.bin/mkimg/tests/Makefile Fri Mar 22 23:55:35 2019 (r345428) @@ -18,6 +18,6 @@ $f: $f.gz.uu CLEANFILES+= ${${PACKAGE}FILES}} rebase: .PHONY - (cd ${.CURDIR}; atf-sh ${_REBASE_SCRIPT}.sh rebase) + (cd ${.CURDIR}; /usr/libexec/atf-sh ${_REBASE_SCRIPT}.sh rebase) .include Modified: stable/12/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow.gz.uu ============================================================================== --- stable/12/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow.gz.uu Fri Mar 22 23:39:16 2019 (r345427) +++ stable/12/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow.gz.uu Fri Mar 22 23:55:35 2019 (r345428) @@ -1,132 +1,132 @@ # $FreeBSD$ begin 644 img-1x1-4096-gpt.qcow.gz -M'XL(",]Q+ED``VEM9RTQ>#$M-#`Y-BUG<'0N<6-O=RYO=70`K9W+CAS7L47G -M^HKDFVR2S8J(S*Q,OFW`!CR3C7MG]P+.Y]`HS_GQ[NH^C^ZHO1D6V!(A4"!R -MH^IP]2I*6CH\'.[^:)I.FK9OVK'9Y^;F[],W:>[]S<-OS8^___5OU_?_^/'; -MW9@Y`3Y%N).0NQ$^1;B3D+L)/D6XDY"[ -M&3Y%N).0NP4^1;B3D+L5/D6XTY"[#3Y%N".?%_>XV^%3A#N-N!/\%.%.(^X$ -M^4X9=QIQ)\AWRKC3B#M!OE/&G4;<"?*=,NXTXDZ0[Y1Q9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/tests/img-1x1-4096-gpt.qcow2.gz.uu ============================================================================== --- stable/12/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow2.gz.uu Fri Mar 22 23:39:16 2019 (r345427) +++ stable/12/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow2.gz.uu Fri Mar 22 23:55:35 2019 (r345428) @@ -1,26 +1,26 @@ # $FreeBSD$ begin 644 img-1x1-4096-gpt.qcow2.gz -M'XL(",]Q+ED``VEM9RTQ>#$M-#`Y-BUG<'0N<6-O=S(N;W5T`*V92V_<(!"` -M[_D5I.\FS=8,8'O[2)JD62FWI&IOO?AYC-1KY?:WUQALUGC&)%MVD945FD^` -MOQFPDR3FPYCB3*9,;EE;LOZW;<#V?LP;Z^YWMYO]3W=D8#PAHI`.*2;3,.&A^8 -M\?D1\L#Q0>SQ"7S]U!CG=Z3KXQ-F?'Y41N'R(`Z0J"V%*X(X@425%*X*XB02 -M55.X)HA32%1+X'A`E1Z7(E&-B[+1)%>/;>X%Q..8U&4=^!Y]]+B7CD<4N^`\@X\[UY;W!N'0^H=4-Z!Y]U;BSMQ -M.*3>`>4=>-Z=6MP[AT/J'5#>@>?=V<([CM0[H+P3GG?O+2MQ.*3>"-X)BY,.A]0[07DG/.^4Q:4.A]0[07DG/.\RB\L=#JEW@O). -M>-YM+>Z#PR'U3E#>"<^[CQ;WR>&0>B+.W7=A<5\< -M#JEWDO).>MY=6MR5PR'U3E+>2<^[:XO[.N$`BYJ\2Q*\6=S-(FE.VYSY$IWK`#SIP/)O5::M.R`@$S[>[.'JR.LWI-L3@$JQHE@` -M?XSC&]*MSR_S;J"W6PW%0`%3%/SI.3?JG-);W:6*V -M;1C.6%N6<7UVZX'=P_WFP<#.-K].[?@DMT9@C>Z@5D\.E3FGIINY!P%BNFR. -MPUXC_=?JZ;IO,*N'+Y)>/31ENG'5QH0;<67/F%6:B -MZ_?R2G=T=YOYUP"E!48;H4S;*F)V:%S$[-"XB-FA<5&S0P,C9H?&1ZB6<-/5GS^>M--N(FKG%1-W&9Z>/WT3]QQ=U%%1H````` +M'XL("-N7?5P``VEM9RTQ>#$M-#`Y-BUG<'0N<6-O=S(N;W5T`*V82V^<,!"` +M[_D53M])FBT>V\"FSR3-2KDE57OKA67A&*D]T_[V8CS@QBO9_;"#V_ADWT=QO;E?[G^;(P63"1!$=6@VX$>O: +MXX##)7+:(6G#D@BHM+B6B)(>#15Q&1"D.IQ=Q.1'%>2>7O5L349QWQ=241QWLEE[W9$%.<=,-X)CZN(*,X["+P[1MPSCZN) +M*,X["+Q[CK@7`TY249QW$'CW$G&O/(ZH=\!Y!X%WKQ'WQN.(>@><=Q!X=X*X +M4X\CZAUPWD'@W1GBWGH<4>^`\PX"[\XGWDFBW@'GG0J\>X>LQ..(>J!Q1[Q3GG0J\4XC3'D?4.\5YIP+O#.)2CR/JG>*\4X%W&>)RCR/JG>*\ +M4X%W:\1=>!Q1[Q3GG0J\>X^X#QY'U#O%>:<"[SXB[I/'$?5.<=[IP+O/B/OB +M<42]TYQW.O#N$G%7'D?4.\UYIP/OKA'W=<`!%35XER1T0]S-)&>!J'K/=PN\OIUZ?8$H#&B*";` +M'_WXNG1K\\N]&VCM-ETQ,"",'G#=7$VY/[Z;S:VXN_SVW<)^^NEVZ59W9X"B +M\B>!?G22G>[) +M\6P=SAXOAJMVV_;+EMB"?33MT;W4'.YNC$LCFZ>[8:0B*T5:V?=)96W_V*7V +MEB;R-DW;A?/3C8^>K7&8Y/2S2":GP'MWJZJ\PY-]W, +M7P28Z8HQCGJ-]%^K9^ORUD1;O366*:KQ'>SJ%6[UZ$6RJT>F3-.O6I]P/6X; +M=_6D>X69V/H]_>4[FKO5^.N`&H'11JC3NHR8'187,3LL+F)V6%S4[+#`B-EA +M<1&SP^(B9H?%1O/WT3^)='8^%1H````` ` end Modified: stable/12/usr.bin/mkimg/tests/img-1x1-4096-gpt.raw.gz.uu ============================================================================== --- stable/12/usr.bin/mkimg/tests/img-1x1-4096-gpt.raw.gz.uu Fri Mar 22 23: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VD@WM;<,XQ`G'.L2-^Y^2\O`+__!T\X@+ +"```` ` end Modified: stable/12/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhd.gz.uu ============================================================================== --- stable/12/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhd.gz.uu Fri Mar 22 23:39:16 2019 (r345427) +++ stable/12/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhd.gz.uu Fri Mar 22 23:55:35 2019 (r345428) @@ -1,22 +1,22 @@ # $FreeBSD$ begin 644 img-1x1-4096-gpt.vhd.gz -M'XL("-!Q+ED``VEM9RTQ>#$M-#`Y-BUG<'0N=FAD+F]U=`"MF$MOVS`,@._] -M%2QVZS!#;R>7`2O0`KMUPX9==K$=IPN&98_VT(/WWT?*4FS9EK&T=%0CB<+/ -M)$61K(3H+P"GP>W!M>`LO2\-N"V4&P"<#$/YNPP?H6M^'MOF\?!4A*N[Z&%2 -MC*52<9)7&@P^I`15T4/O8<@]]N -M>NV(].6@OGOD];>3=GJNW2"%?^4.A`$I1[_043O$%']38PU*[?=^.-BU)'L: -MR8=D8C!VXCLK)E(C-9><*@9CEW!N3>H\Q;*(? -M9@-#Y>GA5_7GH9WHIS*AXD[ZR=F7-3[TWH&"LGY-BQ>?YQOZ -M/&#T8(H[&5PWY#^?!]IVL*@/DB"L-2B971!].?)?O6->WWI_'M!:J*H9\'/4 -MK_'+8<$X,%L*#$P.1H)58(=P]K;:9JS?S>U[N'OW\1/!O@[F-A0NC8*FA*T" -MN9UH-]]IZ[FEH]UN?E3<[<>\M.(N\M;IE8U8KB,L75O-Z3OFK@_L#\/;_G)[J[(GWU -M0!7*$%M=4R&1LFEH`I!-0Q/V+Z.&LEU=S'-7V:A2,688PC%F&,(Q9AC"L688 -M`C)F&,(Q9AC",688PK%F&`0:P=<($#$M-#`Y-BUG<'0N=FAD+F]U=`"MF$MOG#`0@._Y +M%1/UEJH4CQ^PQT9*U?:TK5KET@NP;+JJNGTDAQSH?Z_'V(`7C+K)L`YBU\S' +MO#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I-''&8>YI"J\"T -M>(!(S"BVXYG\L><*'/O$7<<<#QYUF/OT]_X^A)MS/#>DB^FJC/&TQ, -M94NDQY>H"=>1?7>/S_>G'\\+C@>OE@#*%K4:#FJX<5>F[GX]\>\.>5RMRVQ3 -M,H[>00$5N,7$C@?KCFFJ2'<"6IS5!CJ!NI>9_$@$V41&G$N5^.'__;8>5SM5 --[%^#W3\[9-S+LPT````` +M'XL("-R7?5P``VEM9RTQ>#$M-#`Y-BUG<'0N=FAD9BYO=70`K9=-B]LP$(;O +M^153>@ALJ9!D2;:/6]C"WM+2TDLO_M*279I2Z*$'__AJ]!%;CF2Z1;8P"K(> +MS[R:T2B4N@M`<*!=XID?F#^0^)X/=P=+8_WK@.;[:,(&2`S0X08S2#F^,TV@ +MM6^4V5ENLOG-:]\/.+)<1[+"C==9MRT_L,81APONZM;-9S^HY +M+@WK8!`YW"G&J<*1)ZP9"NH!U`22P:"Q,RI@#*`Q:=)8"`<^`FVA9L![!,Z7 +M3^3B8._)KW?>/L%\1*1:?B"GGL!0H4W.W1IC>]==B'%5:?4:5$\64Z_UVU2J +MY0>RZG5.O;1(J%XJ=0W.JT;>Q+B^K'K,5@T3_V;_OGWF!^83B6\'%!Y8S$*A +M]5`P.Q!7,#L05S`[$%.1MG"Q9QQ!4M +MXM(?OU4%RN:7DMBO!2B34LT:R)>8L<#AYV4:?I__K-63=F>&Y9"\:3B?5QB8 +MRJ1(AQ]1(_97]KU]>+H[_W@*..Z]"F.LBH/J;]R5L;O?SOPE*!APB6U* +MKM5K%:X58Y'CWKI3'"K2GH""LY.&1MAU#BWZ$0TD`QEQ(52N[7_7UN%*AXKY +,:W#X"S$T<4>S#0`` ` end Modified: stable/12/usr.bin/mkimg/tests/img-1x1-4096-gpt.vmdk.gz.uu ============================================================================== --- stable/12/usr.bin/mkimg/tests/img-1x1-4096-gpt.vmdk.gz.uu Fri Mar 22 23:39:16 2019 (r345427) +++ stable/12/usr.bin/mkimg/tests/img-1x1-4096-gpt.vm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_.`A<;UR__?N['&7IFN8)X%^XOGE_B]+?C[FHYYOS\LZ\91'AYMS+3M?W +M]3??NC=??O>#!_O[0[KS[9TGH+'Q*'W[:'5(I?OMXUUW2H^M:UQ_#%O2M2<&_6<"?C +M3]Y\Y]GVY*K.WS^XA.OFFSWW)T]+N_-TFBS_\SNZ8^^5"!7U7ZUAFMMJU?.5XU%>/+T[_0+ES>']9\% +ML`B`9BLL_"T%['1[0\.SP<(9GAXV?VV?\!KL<'>[1E```` ` end Modified: stable/12/usr.bin/mkimg/tests/img-1x1-512-gpt.qcow.gz.uu ============================================================================== --- stable/12/usr.bin/mkimg/tests/img-1x1-512-gpt.qcow.gz.uu Fri Mar 22 23:39:16 2019 (r345427) +++ stable/12/usr.bin/mkimg/tests/img-1x1-512-gpt.qcow.gz.uu Fri Mar 22 23:55:35 2019 (r345428) @@ -1,132 +1,132 @@ # $FreeBSD$ begin 644 img-1x1-512-gpt.qcow.gz -M'XL(",5Q+ED``VEM9RTQ>#$M-3$R+6=P="YQ8V]W+F]U=`"MG?U -M%5=OB9*HC(C[U-MNM`'/RH9[UH.ZKQQU&]ES?7PSR?,@(_=6V!!51$$%X6YD -M'BTNJE2KC@Z'NV]-TTG3]DT[-<>EN?GG]"'-O7]X^-'\^-M?_GI]_]N/W^[& -MY/"3I]P_M]I(FGNP]>GUN8P_0MS-Q]P[MZKLW_CU=U[LY=S5[_=O5G\ -MG+)!>S#8I+E#>GU"3J_]UU[?=_=VY>[T'N_M*GF['1OL'PS^GN;^2*]/R=L= -MV-SX8.[DWJZ2MSNQN?FGL"B!96%S:S#7PJ"?&>,.XNX$^0[8]Q9R!WR -MG3'N+.0.^&W"'?M8R[ -M-N0.^:YEW+41=XJ?(MRU$7>*?-.NB[A3Y+N.<==%W"GR7<>XZT+ND.\ZQET7%W"'?=8R[+N0.^:YCW'4A=\AW'>.N#[E#ONL9=WW('?)=S[CK(^X,/T6X -MZR/N#/FN9]SU$7>&?-$W"'?#8R[(>0.^6Y@W`TA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QRN0:(H[\#S +M[KG%O1AQ'(NBO`//NY<6]\KAD'X'E'?@>??:XLX<#NEW0'D'GG=O+.[-Z]LZS4X9!^)RCOA.<=MSAP +M.*3?"=Y\L[K/#(?U.4-Y)S[LO%O?5X9!^ +M)RGOI.?=E<5=.QS2[R3EG?2\N[&X;R,.L*C1NS3%+XO;+FH6D'XGLT?B=DL< +M_6/EF..L=,=MCGS2`RO`XNE`7V!*!2K"P7P)]# +M?GVY=?5EG@UT=JN^&2A@2HZX?JYJ/\UON[ME=U???VC8+S?=OMR:_E]VAX>B +M]++C]'3/EO8I4V[+U1YP@L2=)BA.'R_RPPH.NUC[A\#)M:CQH<,C[JW!Z>/% +M^%.[NZ9MJ[]'BM7E_/G-%+?=SG%99/.D'JXREN]95NOG2?M&_W'(]*\T5G1E +M8K9MZ,]8&Y9S?7;K@.W#??)@8)?)[PN;G^36".RB!ZC5D[!FA$XJ,%TVQV&/ +MD?YK]71?KE2TU=O8-H5=]`"Y>J59/7R1=%)HR;3#J@T%-^"JR*N7Z>&N/KK^ +MO?RD!]J[9/XV0&F!T3*46;./6!T:%[$Z-"YB=6AY/GZ?_`/D@(G0%1H````` ` end Modified: stable/12/usr.bin/mkimg/tests/img-1x1-512-gpt.raw.gz.uu ============================================================================== --- stable/12/usr.bin/mkimg/tests/img-1x1-512-gpt.raw.gz.uu Fri Mar 22 23:39:16 2019 (r345427) +++ stable/12/usr.bin/mkimg/tests/img-1x1-512-gpt.raw.gz.uu Fri Mar 22 23:55:35 2019 (r345428) @@ -1,15 +1,15 @@ # $FreeBSD$ begin 644 img-1x1-512-gpt.raw.gz -M'XL(",9Q+ED``VEM9RTQ>#$M-3$R+6=P="YR87EIJKH,&+Z/(6S'"-6>OQ:8-8YR(N)1N>QG06BC+!?`]Q:?[X[!@')@]Z/"^!*/` -M:K#F%]?G:NMQ?(]/SW"X?WU#V,;L1I]%I4 -M.^$*$K?-XXIXMC0NMVF<6?.*/?2_LXTX*Z=>?NSE+7@-KH:F)'&?$YQC[CR# -MYLK!K@9W!*N@;O&A<:!4B"_(Q/>04-\&Y!YV"G2%P.[T(DX1=B.^KH?XC!HZ -M(K=I`U4]H]@C_+^7=]K0'<3TBD`S`-DB#,WG&-6!.$9U((Y1'8AC50<"&=6! -M.$9U((Y1'8AC54<`>LDWQ!'7#W$#NP::`HKY$*?&<2>^Q6TF7:_71O_*$,\? -CAF<#$M-3$R+6=P="YR87<5G*6!5L-[ +MCQ/C=1037#5Z+5;<,,6)@!O2;?8!K85S"^#7$)_NCL/"I#`YM-\O812LAC4W +M7)>K+:?QG5_?<'G^^"38]YBN5M[H2CB#^H0FN8M._3_=@-/DM:CV@$NBN.,Z +M+@EG&\>MK3C.;'F%'MJ3K`W)WG9F4R\Z(XO:H2DBN/-YCDN9.\^0N4AQ*I'6 +ML`IE0R]5"J6`S,LDZR"^OA5DCI."+@C87M_%-<">Q,]C'Y]1?4>LK;@A5CVC +MMSJ"@OHC79:M>WO^FUE;<$*V>"]5;+U)4,NU0M4$A`ZY@KEY* +M9J\/__]>/N.&]B+F=P":'L@6H6^^E%$=A&-4!^$8U4$X5G40D%$=A&-4!^$8 +MU4$X5G5X8";YACCANB%ND.;J9WAK]&T-\_3`RQB%.N.TA +8GNQ-EG&($XYUB'N@D_+P"ZG]1LB("P`` ` end Modified: stable/12/usr.bin/mkimg/tests/img-1x1-512-gpt.vhd.gz.uu ============================================================================== --- stable/12/usr.bin/mkimg/tests/img-1x1-512-gpt.vhd.gz.uu Fri Mar 22 23:39:16 2019 (r345427) +++ stable/12/usr.bin/mkimg/tests/img-1x1-512-gpt.vhd.gz.uu Fri Mar 22 23:55:35 2019 (r345428) @@ -1,22 +1,22 @@ # $FreeBSD$ begin 644 img-1x1-512-gpt.vhd.gz -M'XL(",9Q+ED``VEM9RTQ>#$M-3$R+6=P="YV:&0N;W5T`*V82W/3,!"`[_D5 -MV^%6!H_>=F[0F3)P*PP,%RY^I62`\&@//9C_CE:6;,NV#&G743U)E/V\+ZVV -M8JR_`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*2";M:EEW$N(K6>\RUCW9]V/H]/Z<$)*PSB""L,X@@K#.)( +M*PP""2L,X@@K#.((*PSB2"N,!;ID)FJ$$.<:H19,`SO[CTL=JY%L:;IW6?8- +M42(V5_*U]BG=""6"(0D;(<2M-D(B'5M_\!-C"1LAQ)$V0MH74J)W&3HT0G,= +MGO(N0X=&:'C\L]YEZ.5&Z*GO,A!'^"X#<83O,A!'G"K8MVS^`DBJ@3\`$P`` ` end Modified: stable/12/usr.bin/mkimg/tests/img-1x1-512-gpt.vhdf.gz.uu ============================================================================== --- stable/12/usr.bin/mkimg/tests/img-1x1-512-gpt.vhdf.gz.uu Fri Mar 22 23:39:16 2019 (r345427) +++ stable/12/usr.bin/mkimg/tests/img-1x1-512-gpt.vhdf.gz.uu Fri Mar 22 23:55:35 2019 (r345428) @@ -1,19 +1,19 @@ # $FreeBSD$ begin 644 img-1x1-512-gpt.vhdf.gz -M'XL(",9Q+ED``VEM9RTQ>#$M-3$R+6=P="YV:&1F+F]U=`"METV/TS`0AN_] -M%8,X5%I$9#NVDQQ!6B1N!1;MA4L^G%4%%"%QX-`?SXSMM'9C!Q8YL:)4DWDR -M\V8FDS+F-@`I@/6)8]YP?EO%^WEWM[,T/CP/B/>G$&Z`%0(=;D0C$W2-,3#/ -M?C%NO9PS_A:-/U]PU77;5P%NNGBM5]X0XBJ'6]*=GP=4"OI^!?R\Q"?LXU`@ -M-<@.!%[/0')0`I2\X&SN:@SCNW_W'@YO/CX0[,LU7<'1.(_036`:0L31\8UT -M'^)T'4X0;J7V@JNSN/VM>@Y7$V[:P*56'B>WO%P-_=NS=3C%8J\V]&H5M`+T -M"%.?Q7V+<+IPY4DR#QJ:$;0!Q6&3Q^J -MDX.]KGZ^\O%)[BLBM?*&G'I2;%4$!?67="'&U:75:TD]54R]SA=+:N4-6?5Z -MIUY:)`HJU;J(\ZI5+V+<4%@]36;L#WQ_KX]YP_E0Q;L#2@\L%J& Delivered-To: svn-src-stable-12@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 CC57115354DC; Sat, 23 Mar 2019 07:07:45 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6BDA882CFC; Sat, 23 Mar 2019 07:07:45 +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 384F74DA6; Sat, 23 Mar 2019 07:07:45 +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 x2N77jBf083787; Sat, 23 Mar 2019 07:07:45 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2N77jDF083786; Sat, 23 Mar 2019 07:07:45 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201903230707.x2N77jDF083786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 23 Mar 2019 07:07:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345440 - stable/12/sys/netpfil/pf X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sys/netpfil/pf X-SVN-Commit-Revision: 345440 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6BDA882CFC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Mar 2019 07:07:46 -0000 Author: kp Date: Sat Mar 23 07:07:44 2019 New Revision: 345440 URL: https://svnweb.freebsd.org/changeset/base/345440 Log: MFC r345223: pf: Rename pfsync bucket lock Previously the main pfsync lock and the bucket locks shared the same name. This lead to spurious warnings from WITNESS like this: acquiring duplicate lock of same type: "pfsync" 1st pfsync @ /usr/src/sys/netpfil/pf/if_pfsync.c:1402 2nd pfsync @ /usr/src/sys/netpfil/pf/if_pfsync.c:1429 It's perfectly okay to grab both the main pfsync lock and a bucket lock at the same time. We don't need different names for each bucket lock, because we should always only acquire a single one of those at a time. Modified: stable/12/sys/netpfil/pf/if_pfsync.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netpfil/pf/if_pfsync.c ============================================================================== --- stable/12/sys/netpfil/pf/if_pfsync.c Sat Mar 23 07:07:41 2019 (r345439) +++ stable/12/sys/netpfil/pf/if_pfsync.c Sat Mar 23 07:07:44 2019 (r345440) @@ -363,7 +363,7 @@ pfsync_clone_create(struct if_clone *ifc, int unit, ca M_PFSYNC, M_ZERO | M_WAITOK); for (c = 0; c < pfsync_buckets; c++) { b = &sc->sc_buckets[c]; - mtx_init(&b->b_mtx, pfsyncname, NULL, MTX_DEF); + mtx_init(&b->b_mtx, "pfsync bucket", NULL, MTX_DEF); b->b_id = c; b->b_sc = sc; From owner-svn-src-stable-12@freebsd.org Sat Mar 23 10:38:29 2019 Return-Path: Delivered-To: svn-src-stable-12@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 896341548AB0; Sat, 23 Mar 2019 10:38:29 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2A45A8A039; Sat, 23 Mar 2019 10:38:29 +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 068297256; Sat, 23 Mar 2019 10:38:29 +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 x2NAcSgc092183; Sat, 23 Mar 2019 10:38:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2NAcS2J092182; Sat, 23 Mar 2019 10:38:28 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201903231038.x2NAcS2J092182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 23 Mar 2019 10:38:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345444 - stable/12/sys/amd64/amd64 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/amd64/amd64 X-SVN-Commit-Revision: 345444 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2A45A8A039 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Mar 2019 10:38:29 -0000 Author: kib Date: Sat Mar 23 10:38:28 2019 New Revision: 345444 URL: https://svnweb.freebsd.org/changeset/base/345444 Log: MFC r345226: amd64: fix switching to the pmap with pti disabled. Modified: stable/12/sys/amd64/amd64/pmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/pmap.c ============================================================================== --- stable/12/sys/amd64/amd64/pmap.c Sat Mar 23 10:37:26 2019 (r345443) +++ stable/12/sys/amd64/amd64/pmap.c Sat Mar 23 10:38:28 2019 (r345444) @@ -7764,12 +7764,11 @@ pmap_pcid_alloc_checked(pmap_t pmap, u_int cpuid) } static void -pmap_activate_sw_pti_post(pmap_t pmap) +pmap_activate_sw_pti_post(struct thread *td, pmap_t pmap) { - if (pmap->pm_ucr3 != PMAP_NO_CR3) - PCPU_GET(tssp)->tss_rsp0 = ((vm_offset_t)PCPU_PTR(pti_stack) + - PC_PTI_STACK_SZ * sizeof(uint64_t)) & ~0xful; + PCPU_GET(tssp)->tss_rsp0 = pmap->pm_ucr3 != PMAP_NO_CR3 ? + PCPU_GET(pti_rsp0) : (uintptr_t)td->td_pcb; } static void inline @@ -7816,15 +7815,16 @@ pmap_activate_sw_pcid_pti(pmap_t pmap, u_int cpuid, co } static void -pmap_activate_sw_pcid_invpcid_pti(pmap_t pmap, u_int cpuid) +pmap_activate_sw_pcid_invpcid_pti(struct thread *td, pmap_t pmap, u_int cpuid) { pmap_activate_sw_pcid_pti(pmap, cpuid, true); - pmap_activate_sw_pti_post(pmap); + pmap_activate_sw_pti_post(td, pmap); } static void -pmap_activate_sw_pcid_noinvpcid_pti(pmap_t pmap, u_int cpuid) +pmap_activate_sw_pcid_noinvpcid_pti(struct thread *td, pmap_t pmap, + u_int cpuid) { register_t rflags; @@ -7848,11 +7848,12 @@ pmap_activate_sw_pcid_noinvpcid_pti(pmap_t pmap, u_int rflags = intr_disable(); pmap_activate_sw_pcid_pti(pmap, cpuid, false); intr_restore(rflags); - pmap_activate_sw_pti_post(pmap); + pmap_activate_sw_pti_post(td, pmap); } static void -pmap_activate_sw_pcid_nopti(pmap_t pmap, u_int cpuid) +pmap_activate_sw_pcid_nopti(struct thread *td __unused, pmap_t pmap, + u_int cpuid) { uint64_t cached, cr3; @@ -7867,17 +7868,19 @@ pmap_activate_sw_pcid_nopti(pmap_t pmap, u_int cpuid) } static void -pmap_activate_sw_pcid_noinvpcid_nopti(pmap_t pmap, u_int cpuid) +pmap_activate_sw_pcid_noinvpcid_nopti(struct thread *td __unused, pmap_t pmap, + u_int cpuid) { register_t rflags; rflags = intr_disable(); - pmap_activate_sw_pcid_nopti(pmap, cpuid); + pmap_activate_sw_pcid_nopti(td, pmap, cpuid); intr_restore(rflags); } static void -pmap_activate_sw_nopcid_nopti(pmap_t pmap, u_int cpuid __unused) +pmap_activate_sw_nopcid_nopti(struct thread *td __unused, pmap_t pmap, + u_int cpuid __unused) { load_cr3(pmap->pm_cr3); @@ -7885,16 +7888,18 @@ pmap_activate_sw_nopcid_nopti(pmap_t pmap, u_int cpuid } static void -pmap_activate_sw_nopcid_pti(pmap_t pmap, u_int cpuid __unused) +pmap_activate_sw_nopcid_pti(struct thread *td, pmap_t pmap, + u_int cpuid __unused) { - pmap_activate_sw_nopcid_nopti(pmap, cpuid); + pmap_activate_sw_nopcid_nopti(td, pmap, cpuid); PCPU_SET(kcr3, pmap->pm_cr3); PCPU_SET(ucr3, pmap->pm_ucr3); - pmap_activate_sw_pti_post(pmap); + pmap_activate_sw_pti_post(td, pmap); } -DEFINE_IFUNC(static, void, pmap_activate_sw_mode, (pmap_t, u_int), static) +DEFINE_IFUNC(static, void, pmap_activate_sw_mode, (struct thread *, pmap_t, + u_int), static) { if (pmap_pcid_enabled && pti && invpcid_works) @@ -7927,7 +7932,7 @@ pmap_activate_sw(struct thread *td) #else CPU_SET(cpuid, &pmap->pm_active); #endif - pmap_activate_sw_mode(pmap, cpuid); + pmap_activate_sw_mode(td, pmap, cpuid); #ifdef SMP CPU_CLR_ATOMIC(cpuid, &oldpmap->pm_active); #else From owner-svn-src-stable-12@freebsd.org Sat Mar 23 10:37:27 2019 Return-Path: Delivered-To: svn-src-stable-12@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 082331548A76; Sat, 23 Mar 2019 10:37:27 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9B93489F4C; Sat, 23 Mar 2019 10:37:26 +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 7872B7253; Sat, 23 Mar 2019 10:37:26 +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 x2NAbQeL092083; Sat, 23 Mar 2019 10:37:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2NAbQ4X092082; Sat, 23 Mar 2019 10:37:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201903231037.x2NAbQ4X092082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 23 Mar 2019 10:37:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345443 - stable/12/sys/amd64/amd64 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/amd64/amd64 X-SVN-Commit-Revision: 345443 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9B93489F4C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Mar 2019 10:37:27 -0000 Author: kib Date: Sat Mar 23 10:37:26 2019 New Revision: 345443 URL: https://svnweb.freebsd.org/changeset/base/345443 Log: MFC r345225: amd64: rewrite cpu_switch.S fragment to reload tss.rsp0 on context switch. Modified: stable/12/sys/amd64/amd64/cpu_switch.S Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/cpu_switch.S ============================================================================== --- stable/12/sys/amd64/amd64/cpu_switch.S Sat Mar 23 10:13:01 2019 (r345442) +++ stable/12/sys/amd64/amd64/cpu_switch.S Sat Mar 23 10:37:26 2019 (r345443) @@ -209,14 +209,11 @@ do_kthread: done_tss: movq %r8,PCPU(RSP0) movq %r8,PCPU(CURPCB) - /* Update the TSS_RSP0 pointer for the next interrupt */ - cmpq $~0,PCPU(UCR3) - je 1f movq PCPU(PTI_RSP0),%rax + cmpq $~0,PCPU(UCR3) + cmove %r8,%rax movq %rax,TSS_RSP0(%rdx) - jmp 2f -1: movq %r8,TSS_RSP0(%rdx) -2: movq %r12,PCPU(CURTHREAD) /* into next thread */ + movq %r12,PCPU(CURTHREAD) /* into next thread */ /* Test if debug registers should be restored. */ testl $PCB_DBREGS,PCB_FLAGS(%r8) From owner-svn-src-stable-12@freebsd.org Sat Mar 23 11:43:44 2019 Return-Path: Delivered-To: svn-src-stable-12@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 77146154BCD8; Sat, 23 Mar 2019 11:43:44 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B7518C73B; Sat, 23 Mar 2019 11:43:44 +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 E5F687E58; Sat, 23 Mar 2019 11:43:43 +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 x2NBhhsK029086; Sat, 23 Mar 2019 11:43:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2NBhfLs029075; Sat, 23 Mar 2019 11:43:41 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201903231143.x2NBhfLs029075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 23 Mar 2019 11:43:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345445 - in stable/12/sys: amd64/amd64 amd64/include arm/arm arm64/arm64 i386/i386 kern mips/mips powerpc/powerpc riscv/riscv sparc64/sparc64 sys X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys: amd64/amd64 amd64/include arm/arm arm64/arm64 i386/i386 kern mips/mips powerpc/powerpc riscv/riscv sparc64/sparc64 sys X-SVN-Commit-Revision: 345445 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0B7518C73B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Mar 2019 11:43:44 -0000 Author: kib Date: Sat Mar 23 11:43:41 2019 New Revision: 345445 URL: https://svnweb.freebsd.org/changeset/base/345445 Log: MFC r345227: amd64: Add md process flags and first P_MD_PTI flag. Modified: stable/12/sys/amd64/amd64/pmap.c stable/12/sys/amd64/amd64/vm_machdep.c stable/12/sys/amd64/include/proc.h stable/12/sys/arm/arm/vm_machdep.c stable/12/sys/arm64/arm64/vm_machdep.c stable/12/sys/i386/i386/vm_machdep.c stable/12/sys/kern/kern_exec.c stable/12/sys/mips/mips/vm_machdep.c stable/12/sys/powerpc/powerpc/vm_machdep.c stable/12/sys/riscv/riscv/vm_machdep.c stable/12/sys/sparc64/sparc64/vm_machdep.c stable/12/sys/sys/proc.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/pmap.c ============================================================================== --- stable/12/sys/amd64/amd64/pmap.c Sat Mar 23 10:38:28 2019 (r345444) +++ stable/12/sys/amd64/amd64/pmap.c Sat Mar 23 11:43:41 2019 (r345445) @@ -2858,6 +2858,7 @@ pmap_unuse_pt(pmap_t pmap, vm_offset_t va, pd_entry_t void pmap_pinit0(pmap_t pmap) { + struct proc *p; int i; PMAP_LOCK_INIT(pmap); @@ -2876,6 +2877,12 @@ pmap_pinit0(pmap_t pmap) pmap->pm_pcids[i].pm_gen = 1; } pmap_activate_boot(pmap); + if (pti) { + p = curproc; + PROC_LOCK(p); + p->p_amd64_md_flags |= P_MD_KPTI; + PROC_UNLOCK(p); + } if ((cpu_stdext_feature2 & CPUID_STDEXT2_PKU) != 0) { pmap_pkru_ranges_zone = uma_zcreate("pkru ranges", @@ -2962,7 +2969,7 @@ pmap_pinit_type(pmap_t pmap, enum pmap_type pm_type, i if (pm_type == PT_X86) { pmap->pm_cr3 = pml4phys; pmap_pinit_pml4(pml4pg); - if (pti) { + if ((curproc->p_amd64_md_flags & P_MD_KPTI) != 0) { pml4pgu = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED | VM_ALLOC_WAITOK); pmap->pm_pml4u = (pml4_entry_t *)PHYS_TO_DMAP( Modified: stable/12/sys/amd64/amd64/vm_machdep.c ============================================================================== --- stable/12/sys/amd64/amd64/vm_machdep.c Sat Mar 23 10:38:28 2019 (r345444) +++ stable/12/sys/amd64/amd64/vm_machdep.c Sat Mar 23 11:43:41 2019 (r345445) @@ -181,6 +181,7 @@ cpu_fork(struct thread *td1, struct proc *p2, struct t /* Point mdproc and then copy over td1's contents */ mdp2 = &p2->p_md; bcopy(&p1->p_md, mdp2, sizeof(*mdp2)); + p2->p_amd64_md_flags = p1->p_amd64_md_flags; /* * Create a new fresh stack for the new process. @@ -367,6 +368,14 @@ cpu_thread_free(struct thread *td) { cpu_thread_clean(td); +} + +bool +cpu_exec_vmspace_reuse(struct proc *p, vm_map_t map) +{ + + return (((curproc->p_amd64_md_flags & P_MD_KPTI) != 0) == + (vm_map_pmap(map)->pm_ucr3 != PMAP_NO_CR3)); } void Modified: stable/12/sys/amd64/include/proc.h ============================================================================== --- stable/12/sys/amd64/include/proc.h Sat Mar 23 10:38:28 2019 (r345444) +++ stable/12/sys/amd64/include/proc.h Sat Mar 23 11:43:41 2019 (r345445) @@ -40,7 +40,8 @@ /* * List of locks - * k - only accessed by curthread + * c - proc lock + * k - only accessed by curthread * pp - pmap.c:invl_gen_mtx */ @@ -70,6 +71,8 @@ struct mdproc { struct proc_ldt *md_ldt; /* (t) per-process ldt */ struct system_segment_descriptor md_ldt_sd; }; + +#define P_MD_KPTI 0x00000001 /* Enable KPTI on exec */ #define KINFO_PROC_SIZE 1088 #define KINFO_PROC32_SIZE 768 Modified: stable/12/sys/arm/arm/vm_machdep.c ============================================================================== --- stable/12/sys/arm/arm/vm_machdep.c Sat Mar 23 10:38:28 2019 (r345444) +++ stable/12/sys/arm/arm/vm_machdep.c Sat Mar 23 11:43:41 2019 (r345445) @@ -347,3 +347,10 @@ cpu_exit(struct thread *td) { } +bool +cpu_exec_vmspace_reuse(struct proc *p __unused, vm_map_t map __unused) +{ + + return (true); +} + Modified: stable/12/sys/arm64/arm64/vm_machdep.c ============================================================================== --- stable/12/sys/arm64/arm64/vm_machdep.c Sat Mar 23 10:38:28 2019 (r345444) +++ stable/12/sys/arm64/arm64/vm_machdep.c Sat Mar 23 11:43:41 2019 (r345445) @@ -264,6 +264,13 @@ cpu_exit(struct thread *td) { } +bool +cpu_exec_vmspace_reuse(struct proc *p __unused, vm_map_t map __unused) +{ + + return (true); +} + void swi_vm(void *v) { Modified: stable/12/sys/i386/i386/vm_machdep.c ============================================================================== --- stable/12/sys/i386/i386/vm_machdep.c Sat Mar 23 10:38:28 2019 (r345444) +++ stable/12/sys/i386/i386/vm_machdep.c Sat Mar 23 11:43:41 2019 (r345445) @@ -386,6 +386,13 @@ cpu_thread_free(struct thread *td) cpu_thread_clean(td); } +bool +cpu_exec_vmspace_reuse(struct proc *p __unused, vm_map_t map __unused) +{ + + return (true); +} + void cpu_set_syscall_retval(struct thread *td, int error) { Modified: stable/12/sys/kern/kern_exec.c ============================================================================== --- stable/12/sys/kern/kern_exec.c Sat Mar 23 10:38:28 2019 (r345444) +++ stable/12/sys/kern/kern_exec.c Sat Mar 23 11:43:41 2019 (r345445) @@ -1100,7 +1100,8 @@ exec_new_vmspace(struct image_params *imgp, struct sys else sv_minuser = MAX(sv->sv_minuser, PAGE_SIZE); if (vmspace->vm_refcnt == 1 && vm_map_min(map) == sv_minuser && - vm_map_max(map) == sv->sv_maxuser) { + vm_map_max(map) == sv->sv_maxuser && + cpu_exec_vmspace_reuse(p, map)) { shmexit(vmspace); pmap_remove_pages(vmspace_pmap(vmspace)); vm_map_remove(map, vm_map_min(map), vm_map_max(map)); Modified: stable/12/sys/mips/mips/vm_machdep.c ============================================================================== --- stable/12/sys/mips/mips/vm_machdep.c Sat Mar 23 10:38:28 2019 (r345444) +++ stable/12/sys/mips/mips/vm_machdep.c Sat Mar 23 11:43:41 2019 (r345445) @@ -455,6 +455,13 @@ cpu_set_upcall(struct thread *td, void (*entry)(void * */ } +bool +cpu_exec_vmspace_reuse(struct proc *p __unused, vm_map_t map __unused) +{ + + return (true); +} + /* * Software interrupt handler for queued VM system processing. */ Modified: stable/12/sys/powerpc/powerpc/vm_machdep.c ============================================================================== --- stable/12/sys/powerpc/powerpc/vm_machdep.c Sat Mar 23 10:38:28 2019 (r345444) +++ stable/12/sys/powerpc/powerpc/vm_machdep.c Sat Mar 23 11:43:41 2019 (r345445) @@ -249,3 +249,10 @@ cpu_thread_swapout(struct thread *td) } +bool +cpu_exec_vmspace_reuse(struct proc *p __unused, vm_map_t map __unused) +{ + + return (true); +} + Modified: stable/12/sys/riscv/riscv/vm_machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/vm_machdep.c Sat Mar 23 10:38:28 2019 (r345444) +++ stable/12/sys/riscv/riscv/vm_machdep.c Sat Mar 23 11:43:41 2019 (r345445) @@ -267,6 +267,13 @@ cpu_exit(struct thread *td) { } +bool +cpu_exec_vmspace_reuse(struct proc *p __unused, vm_map_t map __unused) +{ + + return (true); +} + void swi_vm(void *v) { Modified: stable/12/sys/sparc64/sparc64/vm_machdep.c ============================================================================== --- stable/12/sys/sparc64/sparc64/vm_machdep.c Sat Mar 23 10:38:28 2019 (r345444) +++ stable/12/sys/sparc64/sparc64/vm_machdep.c Sat Mar 23 11:43:41 2019 (r345445) @@ -373,6 +373,13 @@ cpu_fork_kthread_handler(struct thread *td, void (*fun fp->fr_local[1] = (u_long)arg; } +bool +cpu_exec_vmspace_reuse(struct proc *p __unused, vm_map_t map __unused) +{ + + return (true); +} + int is_physical_memory(vm_paddr_t addr) { Modified: stable/12/sys/sys/proc.h ============================================================================== --- stable/12/sys/sys/proc.h Sat Mar 23 10:38:28 2019 (r345444) +++ stable/12/sys/sys/proc.h Sat Mar 23 11:43:41 2019 (r345445) @@ -682,6 +682,7 @@ struct proc { LIST_ENTRY(proc) p_orphan; /* (e) List of orphan processes. */ LIST_HEAD(, proc) p_orphans; /* (e) Pointer to list of orphans. */ uint32_t p_fctl0; /* (x) ABI feature control, ELF note */ + u_int p_amd64_md_flags; /* (c) md process flags P_MD */ }; #define p_session p_pgrp->pg_session @@ -1083,6 +1084,7 @@ void userret(struct thread *, struct trapframe *); void cpu_exit(struct thread *); void exit1(struct thread *, int, int) __dead2; void cpu_copy_thread(struct thread *td, struct thread *td0); +bool cpu_exec_vmspace_reuse(struct proc *p, struct vm_map *map); int cpu_fetch_syscall_args(struct thread *td); void cpu_fork(struct thread *, struct proc *, struct thread *, int); void cpu_fork_kthread_handler(struct thread *, void (*)(void *), void *); From owner-svn-src-stable-12@freebsd.org Sat Mar 23 11:47:18 2019 Return-Path: Delivered-To: svn-src-stable-12@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 A2FF3154BE5D; Sat, 23 Mar 2019 11:47:18 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5320B8C9DA; Sat, 23 Mar 2019 11:47:18 +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 03B837E5E; Sat, 23 Mar 2019 11:47:18 +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 x2NBlHqI029459; Sat, 23 Mar 2019 11:47:17 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2NBlDSD029435; Sat, 23 Mar 2019 11:47:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201903231147.x2NBlDSD029435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 23 Mar 2019 11:47:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345446 - in stable/12/sys: amd64/amd64 amd64/include arm/arm arm/include arm64/arm64 arm64/include compat/freebsd32 i386/i386 i386/include kern mips/include mips/mips powerpc/include p... X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys: amd64/amd64 amd64/include arm/arm arm/include arm64/arm64 arm64/include compat/freebsd32 i386/i386 i386/include kern mips/include mips/mips powerpc/include powerpc/powerpc riscv/incl... X-SVN-Commit-Revision: 345446 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5320B8C9DA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Mar 2019 11:47:19 -0000 Author: kib Date: Sat Mar 23 11:47:13 2019 New Revision: 345446 URL: https://svnweb.freebsd.org/changeset/base/345446 Log: MFC r345228: amd64 KPTI: add control from procctl(2). Added: stable/12/sys/amd64/include/procctl.h - copied unchanged from r345228, head/sys/amd64/include/procctl.h stable/12/sys/arm/include/procctl.h - copied unchanged from r345228, head/sys/arm/include/procctl.h stable/12/sys/arm64/include/procctl.h - copied unchanged from r345228, head/sys/arm64/include/procctl.h stable/12/sys/i386/include/procctl.h - copied unchanged from r345228, head/sys/i386/include/procctl.h stable/12/sys/mips/include/procctl.h - copied unchanged from r345228, head/sys/mips/include/procctl.h stable/12/sys/powerpc/include/procctl.h - copied unchanged from r345228, head/sys/powerpc/include/procctl.h stable/12/sys/riscv/include/procctl.h - copied unchanged from r345228, head/sys/riscv/include/procctl.h stable/12/sys/sparc64/include/procctl.h - copied unchanged from r345228, head/sys/sparc64/include/procctl.h stable/12/sys/x86/include/procctl.h - copied unchanged from r345228, head/sys/x86/include/procctl.h Modified: stable/12/sys/amd64/amd64/vm_machdep.c stable/12/sys/arm/arm/vm_machdep.c stable/12/sys/arm64/arm64/vm_machdep.c stable/12/sys/compat/freebsd32/freebsd32_misc.c stable/12/sys/i386/i386/vm_machdep.c stable/12/sys/kern/kern_procctl.c stable/12/sys/mips/mips/vm_machdep.c stable/12/sys/powerpc/powerpc/vm_machdep.c stable/12/sys/riscv/riscv/vm_machdep.c stable/12/sys/sparc64/sparc64/vm_machdep.c stable/12/sys/sys/proc.h stable/12/sys/sys/procctl.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/vm_machdep.c ============================================================================== --- stable/12/sys/amd64/amd64/vm_machdep.c Sat Mar 23 11:43:41 2019 (r345445) +++ stable/12/sys/amd64/amd64/vm_machdep.c Sat Mar 23 11:47:13 2019 (r345446) @@ -59,13 +59,16 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include #include #include #include +#include #include #include @@ -376,6 +379,66 @@ cpu_exec_vmspace_reuse(struct proc *p, vm_map_t map) return (((curproc->p_amd64_md_flags & P_MD_KPTI) != 0) == (vm_map_pmap(map)->pm_ucr3 != PMAP_NO_CR3)); +} + +static void +cpu_procctl_kpti(struct proc *p, int com, int *val) +{ + + if (com == PROC_KPTI_CTL) { + if (pti && *val == PROC_KPTI_CTL_ENABLE_ON_EXEC) + p->p_amd64_md_flags |= P_MD_KPTI; + if (*val == PROC_KPTI_CTL_DISABLE_ON_EXEC) + p->p_amd64_md_flags &= ~P_MD_KPTI; + } else /* PROC_KPTI_STATUS */ { + *val = (p->p_amd64_md_flags & P_MD_KPTI) != 0 ? + PROC_KPTI_CTL_ENABLE_ON_EXEC: + PROC_KPTI_CTL_DISABLE_ON_EXEC; + if (vmspace_pmap(p->p_vmspace)->pm_ucr3 != PMAP_NO_CR3) + *val |= PROC_KPTI_STATUS_ACTIVE; + } +} + +int +cpu_procctl(struct thread *td, int idtype, id_t id, int com, void *data) +{ + struct proc *p; + int error, val; + + switch (com) { + case PROC_KPTI_CTL: + case PROC_KPTI_STATUS: + if (idtype != P_PID) { + error = EINVAL; + break; + } + if (com == PROC_KPTI_CTL) { + /* sad but true and not a joke */ + error = priv_check(td, PRIV_IO); + if (error != 0) + break; + error = copyin(data, &val, sizeof(val)); + if (error != 0) + break; + if (val != PROC_KPTI_CTL_ENABLE_ON_EXEC && + val != PROC_KPTI_CTL_DISABLE_ON_EXEC) { + error = EINVAL; + break; + } + } + error = pget(id, PGET_CANSEE | PGET_NOTWEXIT | PGET_NOTID, &p); + if (error == 0) { + cpu_procctl_kpti(p, com, &val); + PROC_UNLOCK(p); + if (com == PROC_KPTI_STATUS) + error = copyout(&val, data, sizeof(val)); + } + break; + default: + error = EINVAL; + break; + } + return (error); } void Copied: stable/12/sys/amd64/include/procctl.h (from r345228, head/sys/amd64/include/procctl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/amd64/include/procctl.h Sat Mar 23 11:47:13 2019 (r345446, copy of r345228, head/sys/amd64/include/procctl.h) @@ -0,0 +1,6 @@ +/*- + * This file is in the public domain. + */ +/* $FreeBSD$ */ + +#include Modified: stable/12/sys/arm/arm/vm_machdep.c ============================================================================== --- stable/12/sys/arm/arm/vm_machdep.c Sat Mar 23 11:43:41 2019 (r345445) +++ stable/12/sys/arm/arm/vm_machdep.c Sat Mar 23 11:47:13 2019 (r345446) @@ -354,3 +354,10 @@ cpu_exec_vmspace_reuse(struct proc *p __unused, vm_map return (true); } +int +cpu_procctl(struct thread *td __unused, int idtype __unused, id_t id __unused, + int com __unused, void *data __unused) +{ + + return (EINVAL); +} Copied: stable/12/sys/arm/include/procctl.h (from r345228, head/sys/arm/include/procctl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/arm/include/procctl.h Sat Mar 23 11:47:13 2019 (r345446, copy of r345228, head/sys/arm/include/procctl.h) @@ -0,0 +1,4 @@ +/*- + * This file is in the public domain. + */ +/* $FreeBSD$ */ Modified: stable/12/sys/arm64/arm64/vm_machdep.c ============================================================================== --- stable/12/sys/arm64/arm64/vm_machdep.c Sat Mar 23 11:43:41 2019 (r345445) +++ stable/12/sys/arm64/arm64/vm_machdep.c Sat Mar 23 11:47:13 2019 (r345446) @@ -271,6 +271,14 @@ cpu_exec_vmspace_reuse(struct proc *p __unused, vm_map return (true); } +int +cpu_procctl(struct thread *td __unused, int idtype __unused, id_t id __unused, + int com __unused, void *data __unused) +{ + + return (EINVAL); +} + void swi_vm(void *v) { Copied: stable/12/sys/arm64/include/procctl.h (from r345228, head/sys/arm64/include/procctl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/arm64/include/procctl.h Sat Mar 23 11:47:13 2019 (r345446, copy of r345228, head/sys/arm64/include/procctl.h) @@ -0,0 +1,4 @@ +/*- + * This file is in the public domain. + */ +/* $FreeBSD$ */ Modified: stable/12/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/12/sys/compat/freebsd32/freebsd32_misc.c Sat Mar 23 11:43:41 2019 (r345445) +++ stable/12/sys/compat/freebsd32/freebsd32_misc.c Sat Mar 23 11:47:13 2019 (r345446) @@ -3350,6 +3350,10 @@ freebsd32_procctl(struct thread *td, struct freebsd32_ } x32; int error, error1, flags, signum; + if (uap->com >= PROC_PROCCTL_MD_MIN) + return (cpu_procctl(td, uap->idtype, PAIR32TO64(id_t, uap->id), + uap->com, PTRIN(uap->data))); + switch (uap->com) { case PROC_ASLR_CTL: case PROC_SPROTECT: Modified: stable/12/sys/i386/i386/vm_machdep.c ============================================================================== --- stable/12/sys/i386/i386/vm_machdep.c Sat Mar 23 11:43:41 2019 (r345445) +++ stable/12/sys/i386/i386/vm_machdep.c Sat Mar 23 11:47:13 2019 (r345446) @@ -393,6 +393,14 @@ cpu_exec_vmspace_reuse(struct proc *p __unused, vm_map return (true); } +int +cpu_procctl(struct thread *td __unused, int idtype __unused, id_t id __unused, + int com __unused, void *data __unused) +{ + + return (EINVAL); +} + void cpu_set_syscall_retval(struct thread *td, int error) { Copied: stable/12/sys/i386/include/procctl.h (from r345228, head/sys/i386/include/procctl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/i386/include/procctl.h Sat Mar 23 11:47:13 2019 (r345446, copy of r345228, head/sys/i386/include/procctl.h) @@ -0,0 +1,6 @@ +/*- + * This file is in the public domain. + */ +/* $FreeBSD$ */ + +#include Modified: stable/12/sys/kern/kern_procctl.c ============================================================================== --- stable/12/sys/kern/kern_procctl.c Sat Mar 23 11:43:41 2019 (r345445) +++ stable/12/sys/kern/kern_procctl.c Sat Mar 23 11:47:13 2019 (r345446) @@ -494,6 +494,10 @@ sys_procctl(struct thread *td, struct procctl_args *ua } x; int error, error1, flags, signum; + if (uap->com >= PROC_PROCCTL_MD_MIN) + return (cpu_procctl(td, uap->idtype, uap->id, + uap->com, uap->data)); + switch (uap->com) { case PROC_ASLR_CTL: case PROC_SPROTECT: Copied: stable/12/sys/mips/include/procctl.h (from r345228, head/sys/mips/include/procctl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/mips/include/procctl.h Sat Mar 23 11:47:13 2019 (r345446, copy of r345228, head/sys/mips/include/procctl.h) @@ -0,0 +1,4 @@ +/*- + * This file is in the public domain. + */ +/* $FreeBSD$ */ Modified: stable/12/sys/mips/mips/vm_machdep.c ============================================================================== --- stable/12/sys/mips/mips/vm_machdep.c Sat Mar 23 11:43:41 2019 (r345445) +++ stable/12/sys/mips/mips/vm_machdep.c Sat Mar 23 11:47:13 2019 (r345446) @@ -462,6 +462,14 @@ cpu_exec_vmspace_reuse(struct proc *p __unused, vm_map return (true); } +int +cpu_procctl(struct thread *td __unused, int idtype __unused, id_t id __unused, + int com __unused, void *data __unused) +{ + + return (EINVAL); +} + /* * Software interrupt handler for queued VM system processing. */ Copied: stable/12/sys/powerpc/include/procctl.h (from r345228, head/sys/powerpc/include/procctl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/powerpc/include/procctl.h Sat Mar 23 11:47:13 2019 (r345446, copy of r345228, head/sys/powerpc/include/procctl.h) @@ -0,0 +1,4 @@ +/*- + * This file is in the public domain. + */ +/* $FreeBSD$ */ Modified: stable/12/sys/powerpc/powerpc/vm_machdep.c ============================================================================== --- stable/12/sys/powerpc/powerpc/vm_machdep.c Sat Mar 23 11:43:41 2019 (r345445) +++ stable/12/sys/powerpc/powerpc/vm_machdep.c Sat Mar 23 11:47:13 2019 (r345446) @@ -256,3 +256,10 @@ cpu_exec_vmspace_reuse(struct proc *p __unused, vm_map return (true); } +int +cpu_procctl(struct thread *td __unused, int idtype __unused, id_t id __unused, + int com __unused, void *data __unused) +{ + + return (EINVAL); +} Copied: stable/12/sys/riscv/include/procctl.h (from r345228, head/sys/riscv/include/procctl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/riscv/include/procctl.h Sat Mar 23 11:47:13 2019 (r345446, copy of r345228, head/sys/riscv/include/procctl.h) @@ -0,0 +1,4 @@ +/*- + * This file is in the public domain. + */ +/* $FreeBSD$ */ Modified: stable/12/sys/riscv/riscv/vm_machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/vm_machdep.c Sat Mar 23 11:43:41 2019 (r345445) +++ stable/12/sys/riscv/riscv/vm_machdep.c Sat Mar 23 11:47:13 2019 (r345446) @@ -274,6 +274,14 @@ cpu_exec_vmspace_reuse(struct proc *p __unused, vm_map return (true); } +int +cpu_procctl(struct thread *td __unused, int idtype __unused, id_t id __unused, + int com __unused, void *data __unused) +{ + + return (EINVAL); +} + void swi_vm(void *v) { Copied: stable/12/sys/sparc64/include/procctl.h (from r345228, head/sys/sparc64/include/procctl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/sparc64/include/procctl.h Sat Mar 23 11:47:13 2019 (r345446, copy of r345228, head/sys/sparc64/include/procctl.h) @@ -0,0 +1,4 @@ +/*- + * This file is in the public domain. + */ +/* $FreeBSD$ */ Modified: stable/12/sys/sparc64/sparc64/vm_machdep.c ============================================================================== --- stable/12/sys/sparc64/sparc64/vm_machdep.c Sat Mar 23 11:43:41 2019 (r345445) +++ stable/12/sys/sparc64/sparc64/vm_machdep.c Sat Mar 23 11:47:13 2019 (r345446) @@ -381,6 +381,14 @@ cpu_exec_vmspace_reuse(struct proc *p __unused, vm_map } int +cpu_procctl(struct thread *td __unused, int idtype __unused, id_t id __unused, + int com __unused, void *data __unused) +{ + + return (EINVAL); +} + +int is_physical_memory(vm_paddr_t addr) { struct ofw_mem_region *mr; Modified: stable/12/sys/sys/proc.h ============================================================================== --- stable/12/sys/sys/proc.h Sat Mar 23 11:43:41 2019 (r345445) +++ stable/12/sys/sys/proc.h Sat Mar 23 11:47:13 2019 (r345446) @@ -1088,6 +1088,8 @@ bool cpu_exec_vmspace_reuse(struct proc *p, struct vm_ int cpu_fetch_syscall_args(struct thread *td); void cpu_fork(struct thread *, struct proc *, struct thread *, int); void cpu_fork_kthread_handler(struct thread *, void (*)(void *), void *); +int cpu_procctl(struct thread *td, int idtype, id_t id, int com, + void *data); void cpu_set_syscall_retval(struct thread *, int); void cpu_set_upcall(struct thread *, void (*)(void *), void *, stack_t *); Modified: stable/12/sys/sys/procctl.h ============================================================================== --- stable/12/sys/sys/procctl.h Sat Mar 23 11:43:41 2019 (r345445) +++ stable/12/sys/sys/procctl.h Sat Mar 23 11:47:13 2019 (r345446) @@ -41,6 +41,10 @@ #include #endif +/* MD PROCCTL verbs start at 0x10000000 */ +#define PROC_PROCCTL_MD_MIN 0x10000000 +#include + #define PROC_SPROTECT 1 /* set protected state */ #define PROC_REAP_ACQUIRE 2 /* reaping enable */ #define PROC_REAP_RELEASE 3 /* reaping disable */ Copied: stable/12/sys/x86/include/procctl.h (from r345228, head/sys/x86/include/procctl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/x86/include/procctl.h Sat Mar 23 11:47:13 2019 (r345446, copy of r345228, head/sys/x86/include/procctl.h) @@ -0,0 +1,43 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 The FreeBSD Foundation + * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _X86_PROCCTL_H +#define _X86_PROCCTL_H + +#define PROC_KPTI_CTL (PROC_PROCCTL_MD_MIN + 0) +#define PROC_KPTI_STATUS (PROC_PROCCTL_MD_MIN + 1) + +#define PROC_KPTI_CTL_ENABLE_ON_EXEC 1 +#define PROC_KPTI_CTL_DISABLE_ON_EXEC 2 +#define PROC_KPTI_STATUS_ACTIVE 0x80000000 + +#endif From owner-svn-src-stable-12@freebsd.org Sat Mar 23 11:51:13 2019 Return-Path: Delivered-To: svn-src-stable-12@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 9CC49154BFB1; Sat, 23 Mar 2019 11:51:13 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 401248CD15; Sat, 23 Mar 2019 11:51:13 +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 002C57E9A; Sat, 23 Mar 2019 11:51:12 +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 x2NBpC8t031937; Sat, 23 Mar 2019 11:51:12 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2NBpCN8031936; Sat, 23 Mar 2019 11:51:12 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201903231151.x2NBpCN8031936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 23 Mar 2019 11:51:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345447 - stable/12/usr.bin/proccontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/usr.bin/proccontrol X-SVN-Commit-Revision: 345447 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 401248CD15 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Mar 2019 11:51:14 -0000 Author: kib Date: Sat Mar 23 11:51:12 2019 New Revision: 345447 URL: https://svnweb.freebsd.org/changeset/base/345447 Log: MFC r345229: proccontrol(1): Add kpti control mode. Modified: stable/12/usr.bin/proccontrol/proccontrol.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/proccontrol/proccontrol.c ============================================================================== --- stable/12/usr.bin/proccontrol/proccontrol.c Sat Mar 23 11:47:13 2019 (r345446) +++ stable/12/usr.bin/proccontrol/proccontrol.c Sat Mar 23 11:51:12 2019 (r345447) @@ -43,6 +43,9 @@ enum { MODE_INVALID, MODE_TRACE, MODE_TRAPCAP, +#ifdef PROC_KPTI_CTL + MODE_KPTI, +#endif }; static pid_t @@ -59,11 +62,18 @@ str2pid(const char *str) return (res); } +#ifdef PROC_KPTI_CTL +#define KPTI_USAGE "|kpti" +#else +#define KPTI_USAGE +#endif + static void __dead2 usage(void) { - fprintf(stderr, "Usage: proccontrol -m (aslr|trace|trapcap) [-q] " + fprintf(stderr, "Usage: proccontrol -m (aslr|trace|trapcap" + KPTI_USAGE") [-q] " "[-s (enable|disable)] [-p pid | command]\n"); exit(1); } @@ -88,6 +98,10 @@ main(int argc, char *argv[]) mode = MODE_TRACE; else if (strcmp(optarg, "trapcap") == 0) mode = MODE_TRAPCAP; +#ifdef PROC_KPTI_CTL + else if (strcmp(optarg, "kpti") == 0) + mode = MODE_KPTI; +#endif else usage(); break; @@ -133,6 +147,11 @@ main(int argc, char *argv[]) case MODE_TRAPCAP: error = procctl(P_PID, pid, PROC_TRAPCAP_STATUS, &arg); break; +#ifdef PROC_KPTI_CTL + case MODE_KPTI: + error = procctl(P_PID, pid, PROC_KPTI_STATUS, &arg); + break; +#endif default: usage(); break; @@ -175,6 +194,22 @@ main(int argc, char *argv[]) break; } break; +#ifdef PROC_KPTI_CTL + case MODE_KPTI: + switch (arg & ~PROC_KPTI_STATUS_ACTIVE) { + case PROC_KPTI_CTL_ENABLE_ON_EXEC: + printf("enabled"); + break; + case PROC_KPTI_CTL_DISABLE_ON_EXEC: + printf("disabled"); + break; + } + if ((arg & PROC_KPTI_STATUS_ACTIVE) != 0) + printf(", active\n"); + else + printf(", not active\n"); + break; +#endif } } else { switch (mode) { @@ -193,6 +228,13 @@ main(int argc, char *argv[]) PROC_TRAPCAP_CTL_DISABLE; error = procctl(P_PID, pid, PROC_TRAPCAP_CTL, &arg); break; +#ifdef PROC_KPTI_CTL + case MODE_KPTI: + arg = enable ? PROC_KPTI_CTL_ENABLE_ON_EXEC : + PROC_KPTI_CTL_DISABLE_ON_EXEC; + error = procctl(P_PID, pid, PROC_KPTI_CTL, &arg); + break; +#endif default: usage(); break; From owner-svn-src-stable-12@freebsd.org Sat Mar 23 16:30:52 2019 Return-Path: Delivered-To: svn-src-stable-12@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 E7DD615558B2; Sat, 23 Mar 2019 16:30:51 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C16F70637; Sat, 23 Mar 2019 16:30:51 +0000 (UTC) (envelope-from chuck@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 6473AAEB8; Sat, 23 Mar 2019 16:30:51 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2NGUplu079468; Sat, 23 Mar 2019 16:30:51 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2NGUpBi079467; Sat, 23 Mar 2019 16:30:51 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <201903231630.x2NGUpBi079467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Sat, 23 Mar 2019 16:30:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345451 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 345451 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8C16F70637 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.940,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Mar 2019 16:30:52 -0000 Author: chuck Date: Sat Mar 23 16:30:50 2019 New Revision: 345451 URL: https://svnweb.freebsd.org/changeset/base/345451 Log: MFC r342762: bhyve(8): Fix bhyve's NVMe Completion Queue entry values Approved by: imp (mentor) Modified: stable/12/usr.sbin/bhyve/pci_nvme.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_nvme.c Sat Mar 23 15:41:32 2019 (r345450) +++ stable/12/usr.sbin/bhyve/pci_nvme.c Sat Mar 23 16:30:50 2019 (r345451) @@ -947,6 +947,7 @@ pci_nvme_handle_admin_cmd(struct pci_nvme_softc* sc, u cq = &sc->compl_queues[0]; cp = &(cq->qbase)[cq->tail]; + cp->cdw0 = compl.cdw0; cp->sqid = 0; cp->sqhd = sqhead; cp->cid = cmd->cid; From owner-svn-src-stable-12@freebsd.org Sat Mar 23 16:42:06 2019 Return-Path: Delivered-To: svn-src-stable-12@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 1031C1555DB7; Sat, 23 Mar 2019 16:42:06 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A066470EF3; Sat, 23 Mar 2019 16:42:05 +0000 (UTC) (envelope-from chuck@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 73A3EB1D2; Sat, 23 Mar 2019 16:42:05 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2NGg5jV087272; Sat, 23 Mar 2019 16:42:05 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2NGg5eC087271; Sat, 23 Mar 2019 16:42:05 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <201903231642.x2NGg5eC087271@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Sat, 23 Mar 2019 16:42:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345453 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 345453 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A066470EF3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.945,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Mar 2019 16:42:06 -0000 Author: chuck Date: Sat Mar 23 16:42:05 2019 New Revision: 345453 URL: https://svnweb.freebsd.org/changeset/base/345453 Log: MFC r342761: bhyve(8): Fix bhyve's NVMe queue bookkeeping Approved by: imp (mentor) Modified: stable/12/usr.sbin/bhyve/pci_nvme.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_nvme.c Sat Mar 23 16:36:18 2019 (r345452) +++ stable/12/usr.sbin/bhyve/pci_nvme.c Sat Mar 23 16:42:05 2019 (r345453) @@ -93,6 +93,16 @@ static int nvme_debug = 0; /* helpers */ +/* Convert a zero-based value into a one-based value */ +#define ONE_BASED(zero) ((zero) + 1) +/* Convert a one-based value into a zero-based value */ +#define ZERO_BASED(one) ((one) - 1) + +/* Encode number of SQ's and CQ's for Set/Get Features */ +#define NVME_FEATURE_NUM_QUEUES(sc) \ + (ZERO_BASED((sc)->num_squeues) & 0xffff) | \ + (ZERO_BASED((sc)->num_cqueues) & 0xffff) << 16; + #define NVME_DOORBELL_OFFSET offsetof(struct nvme_registers, doorbell) enum nvme_controller_register_offsets { @@ -192,8 +202,8 @@ struct pci_nvme_softc { struct pci_nvme_blockstore nvstore; - uint16_t max_qentries; /* max entries per queue */ - uint32_t max_queues; + uint16_t max_qentries; /* max entries per queue */ + uint32_t max_queues; /* max number of IO SQ's or CQ's */ uint32_t num_cqueues; uint32_t num_squeues; @@ -203,7 +213,10 @@ struct pci_nvme_softc { uint32_t ioslots; sem_t iosemlock; - /* status and guest memory mapped queues */ + /* + * Memory mapped Submission and Completion queues + * Each array includes both Admin and IO queues + */ struct nvme_completion_queue *compl_queues; struct nvme_submission_queue *submit_queues; @@ -357,7 +370,7 @@ pci_nvme_reset_locked(struct pci_nvme_softc *sc) { DPRINTF(("%s\r\n", __func__)); - sc->regs.cap_lo = (sc->max_qentries & NVME_CAP_LO_REG_MQES_MASK) | + sc->regs.cap_lo = (ZERO_BASED(sc->max_qentries) & NVME_CAP_LO_REG_MQES_MASK) | (1 << NVME_CAP_LO_REG_CQR_SHIFT) | (60 << NVME_CAP_LO_REG_TO_SHIFT); @@ -370,7 +383,7 @@ pci_nvme_reset_locked(struct pci_nvme_softc *sc) sc->num_cqueues = sc->num_squeues = sc->max_queues; if (sc->submit_queues != NULL) { - for (int i = 0; i <= sc->max_queues; i++) { + for (int i = 0; i < sc->num_squeues + 1; i++) { /* * The Admin Submission Queue is at index 0. * It must not be changed at reset otherwise the @@ -380,26 +393,31 @@ pci_nvme_reset_locked(struct pci_nvme_softc *sc) sc->submit_queues[i].qbase = NULL; sc->submit_queues[i].size = 0; sc->submit_queues[i].cqid = 0; - - sc->compl_queues[i].qbase = NULL; - sc->compl_queues[i].size = 0; } sc->submit_queues[i].tail = 0; sc->submit_queues[i].head = 0; sc->submit_queues[i].busy = 0; - - sc->compl_queues[i].tail = 0; - sc->compl_queues[i].head = 0; } } else - sc->submit_queues = calloc(sc->max_queues + 1, + sc->submit_queues = calloc(sc->num_squeues + 1, sizeof(struct nvme_submission_queue)); - if (sc->compl_queues == NULL) { - sc->compl_queues = calloc(sc->max_queues + 1, + if (sc->compl_queues != NULL) { + for (int i = 0; i < sc->num_cqueues + 1; i++) { + /* See Admin Submission Queue note above */ + if (i != 0) { + sc->compl_queues[i].qbase = NULL; + sc->compl_queues[i].size = 0; + } + + sc->compl_queues[i].tail = 0; + sc->compl_queues[i].head = 0; + } + } else { + sc->compl_queues = calloc(sc->num_cqueues + 1, sizeof(struct nvme_completion_queue)); - for (int i = 0; i <= sc->num_cqueues; i++) + for (int i = 0; i < sc->num_cqueues + 1; i++) pthread_mutex_init(&sc->compl_queues[i].mtx, NULL); } } @@ -443,7 +461,7 @@ nvme_opc_delete_io_sq(struct pci_nvme_softc* sc, struc uint16_t qid = command->cdw10 & 0xffff; DPRINTF(("%s DELETE_IO_SQ %u\r\n", __func__, qid)); - if (qid == 0 || qid > sc->num_cqueues) { + if (qid == 0 || qid > sc->num_squeues) { WPRINTF(("%s NOT PERMITTED queue id %u / num_squeues %u\r\n", __func__, qid, sc->num_squeues)); pci_nvme_status_tc(&compl->status, NVME_SCT_COMMAND_SPECIFIC, @@ -464,7 +482,7 @@ nvme_opc_create_io_sq(struct pci_nvme_softc* sc, struc uint16_t qid = command->cdw10 & 0xffff; struct nvme_submission_queue *nsq; - if (qid > sc->num_squeues) { + if ((qid == 0) || (qid > sc->num_squeues)) { WPRINTF(("%s queue index %u > num_squeues %u\r\n", __func__, qid, sc->num_squeues)); pci_nvme_status_tc(&compl->status, @@ -474,7 +492,7 @@ nvme_opc_create_io_sq(struct pci_nvme_softc* sc, struc } nsq = &sc->submit_queues[qid]; - nsq->size = ((command->cdw10 >> 16) & 0xffff) + 1; + nsq->size = ONE_BASED((command->cdw10 >> 16) & 0xffff); nsq->qbase = vm_map_gpa(sc->nsc_pi->pi_vmctx, command->prp1, sizeof(struct nvme_command) * (size_t)nsq->size); @@ -529,7 +547,7 @@ nvme_opc_create_io_cq(struct pci_nvme_softc* sc, struc uint16_t qid = command->cdw10 & 0xffff; struct nvme_completion_queue *ncq; - if (qid > sc->num_cqueues) { + if ((qid == 0) || (qid > sc->num_cqueues)) { WPRINTF(("%s queue index %u > num_cqueues %u\r\n", __func__, qid, sc->num_cqueues)); pci_nvme_status_tc(&compl->status, @@ -541,7 +559,7 @@ nvme_opc_create_io_cq(struct pci_nvme_softc* sc, struc ncq = &sc->compl_queues[qid]; ncq->intr_en = (command->cdw11 & NVME_CMD_CDW11_IEN) >> 1; ncq->intr_vec = (command->cdw11 >> 16) & 0xffff; - ncq->size = ((command->cdw10 >> 16) & 0xffff) + 1; + ncq->size = ONE_BASED((command->cdw10 >> 16) & 0xffff); ncq->qbase = vm_map_gpa(sc->nsc_pi->pi_vmctx, command->prp1, @@ -649,6 +667,45 @@ nvme_opc_identify(struct pci_nvme_softc* sc, struct nv } static int +nvme_set_feature_queues(struct pci_nvme_softc* sc, struct nvme_command* command, + struct nvme_completion* compl) +{ + uint16_t nqr; /* Number of Queues Requested */ + + nqr = command->cdw11 & 0xFFFF; + if (nqr == 0xffff) { + WPRINTF(("%s: Illegal NSQR value %#x\n", __func__, nqr)); + pci_nvme_status_genc(&compl->status, NVME_SC_INVALID_FIELD); + return (-1); + } + + sc->num_squeues = ONE_BASED(nqr); + if (sc->num_squeues > sc->max_queues) { + DPRINTF(("NSQR=%u is greater than max %u\n", sc->num_squeues, + sc->max_queues)); + sc->num_squeues = sc->max_queues; + } + + nqr = (command->cdw11 >> 16) & 0xFFFF; + if (nqr == 0xffff) { + WPRINTF(("%s: Illegal NCQR value %#x\n", __func__, nqr)); + pci_nvme_status_genc(&compl->status, NVME_SC_INVALID_FIELD); + return (-1); + } + + sc->num_cqueues = ONE_BASED(nqr); + if (sc->num_cqueues > sc->max_queues) { + DPRINTF(("NCQR=%u is greater than max %u\n", sc->num_cqueues, + sc->max_queues)); + sc->num_cqueues = sc->max_queues; + } + + compl->cdw0 = NVME_FEATURE_NUM_QUEUES(sc); + + return (0); +} + +static int nvme_opc_set_features(struct pci_nvme_softc* sc, struct nvme_command* command, struct nvme_completion* compl) { @@ -678,19 +735,7 @@ nvme_opc_set_features(struct pci_nvme_softc* sc, struc DPRINTF((" volatile write cache 0x%x\r\n", command->cdw11)); break; case NVME_FEAT_NUMBER_OF_QUEUES: - sc->num_squeues = command->cdw11 & 0xFFFF; - sc->num_cqueues = (command->cdw11 >> 16) & 0xFFFF; - DPRINTF((" number of queues (submit %u, completion %u)\r\n", - sc->num_squeues, sc->num_cqueues)); - - if (sc->num_squeues == 0 || sc->num_squeues > sc->max_queues) - sc->num_squeues = sc->max_queues; - if (sc->num_cqueues == 0 || sc->num_cqueues > sc->max_queues) - sc->num_cqueues = sc->max_queues; - - compl->cdw0 = (sc->num_squeues & 0xFFFF) | - ((sc->num_cqueues & 0xFFFF) << 16); - + nvme_set_feature_queues(sc, command, compl); break; case NVME_FEAT_INTERRUPT_COALESCING: DPRINTF((" interrupt coalescing 0x%x\r\n", command->cdw11)); @@ -706,7 +751,7 @@ nvme_opc_set_features(struct pci_nvme_softc* sc, struc DPRINTF((" interrupt vector configuration 0x%x\r\n", command->cdw11)); - for (uint32_t i = 0; i <= sc->num_cqueues; i++) { + for (uint32_t i = 0; i < sc->num_cqueues + 1; i++) { if (sc->compl_queues[i].intr_vec == iv) { if (command->cdw11 & (1 << 16)) sc->compl_queues[i].intr_en |= @@ -788,17 +833,8 @@ nvme_opc_get_features(struct pci_nvme_softc* sc, struc DPRINTF((" volatile write cache\r\n")); break; case NVME_FEAT_NUMBER_OF_QUEUES: - compl->cdw0 = 0; - if (sc->num_squeues == 0) - compl->cdw0 |= sc->max_queues & 0xFFFF; - else - compl->cdw0 |= sc->num_squeues & 0xFFFF; + compl->cdw0 = NVME_FEATURE_NUM_QUEUES(sc); - if (sc->num_cqueues == 0) - compl->cdw0 |= (sc->max_queues & 0xFFFF) << 16; - else - compl->cdw0 |= (sc->num_cqueues & 0xFFFF) << 16; - DPRINTF((" number of queues (submit %u, completion %u)\r\n", compl->cdw0 & 0xFFFF, (compl->cdw0 >> 16) & 0xFFFF)); @@ -1813,7 +1849,7 @@ pci_nvme_init(struct vmctx *ctx, struct pci_devinst *p /* allocate size of nvme registers + doorbell space for all queues */ pci_membar_sz = sizeof(struct nvme_registers) + - 2*sizeof(uint32_t)*(sc->max_queues); + 2*sizeof(uint32_t)*(sc->max_queues + 1); DPRINTF(("nvme membar size: %u\r\n", pci_membar_sz)); @@ -1823,7 +1859,7 @@ pci_nvme_init(struct vmctx *ctx, struct pci_devinst *p goto done; } - error = pci_emul_add_msixcap(pi, sc->max_queues, NVME_MSIX_BAR); + error = pci_emul_add_msixcap(pi, sc->max_queues + 1, NVME_MSIX_BAR); if (error) { WPRINTF(("%s pci add msixcap failed\r\n", __func__)); goto done; From owner-svn-src-stable-12@freebsd.org Sat Mar 23 16:46:34 2019 Return-Path: Delivered-To: svn-src-stable-12@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 CE6521555F9F; Sat, 23 Mar 2019 16:46:34 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6E5DA711B9; Sat, 23 Mar 2019 16:46:34 +0000 (UTC) (envelope-from chuck@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 1A156B20C; Sat, 23 Mar 2019 16:46:34 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2NGkXoQ088251; Sat, 23 Mar 2019 16:46:33 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2NGkXNN088250; Sat, 23 Mar 2019 16:46:33 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <201903231646.x2NGkXNN088250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Sat, 23 Mar 2019 16:46:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345454 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 345454 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6E5DA711B9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.940,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Mar 2019 16:46:35 -0000 Author: chuck Date: Sat Mar 23 16:46:33 2019 New Revision: 345454 URL: https://svnweb.freebsd.org/changeset/base/345454 Log: MFC r345170: bhyve(8): Fix bhyve's NVMe Identify Namespace data Approved by: imp (mentor) Modified: stable/12/usr.sbin/bhyve/pci_nvme.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_nvme.c Sat Mar 23 16:42:05 2019 (r345453) +++ stable/12/usr.sbin/bhyve/pci_nvme.c Sat Mar 23 16:46:33 2019 (r345454) @@ -358,7 +358,7 @@ pci_nvme_init_nsdata(struct pci_nvme_softc *sc) nd->nuse = nd->nsze; /* Get LBA and backstore information from backing store */ - nd->nlbaf = 1; + nd->nlbaf = 0; /* NLBAF is a 0's based value (i.e. 1 LBA Format) */ /* LBA data-sz = 2^lbads */ nd->lbaf[0] = sc->nvstore.sectsz_bits << NVME_NS_DATA_LBAF_LBADS_SHIFT; From owner-svn-src-stable-12@freebsd.org Sat Mar 23 22:44:13 2019 Return-Path: Delivered-To: svn-src-stable-12@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 CCDC6155F275; Sat, 23 Mar 2019 22:44:12 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6AA4285FD8; Sat, 23 Mar 2019 22:44:12 +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 3A9B5F1AF; Sat, 23 Mar 2019 22:44:12 +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 x2NMiCPJ077834; Sat, 23 Mar 2019 22:44:12 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2NMiBU3077832; Sat, 23 Mar 2019 22:44:11 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201903232244.x2NMiBU3077832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sat, 23 Mar 2019 22:44:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345459 - stable/12/sys/compat/ndis X-SVN-Group: stable-12 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: stable/12/sys/compat/ndis X-SVN-Commit-Revision: 345459 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6AA4285FD8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Mar 2019 22:44:13 -0000 Author: gonzo Date: Sat Mar 23 22:44:11 2019 New Revision: 345459 URL: https://svnweb.freebsd.org/changeset/base/345459 Log: MFC r343298: [ndis] Fix unregistered use of FPU by NDIS in kernel on amd64 amd64 miniport drivers are allowed to use FPU which triggers "Unregistered use of FPU in kernel" panic. Wrap all variants of MSCALL with fpu_kern_enter/fpu_kern_leave. To reduce amount of allocations/deallocations done via fpu_kern_alloc_ctx/fpu_kern_free_ctx maintain cache of fpu_kern_ctx elements. Based on the patch by Paul B Mahol PR: 165622 Submitted by: Vlad Movchan Modified: stable/12/sys/compat/ndis/kern_windrv.c stable/12/sys/compat/ndis/pe_var.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/ndis/kern_windrv.c ============================================================================== --- stable/12/sys/compat/ndis/kern_windrv.c Sat Mar 23 21:36:59 2019 (r345458) +++ stable/12/sys/compat/ndis/kern_windrv.c Sat Mar 23 22:44:11 2019 (r345459) @@ -58,6 +58,10 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef __amd64__ +#include +#endif + #include #include @@ -68,6 +72,19 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef __amd64__ +struct fpu_cc_ent { + struct fpu_kern_ctx *ctx; + LIST_ENTRY(fpu_cc_ent) entries; +}; +static LIST_HEAD(fpu_ctx_free, fpu_cc_ent) fpu_free_head = + LIST_HEAD_INITIALIZER(fpu_free_head); +static LIST_HEAD(fpu_ctx_busy, fpu_cc_ent) fpu_busy_head = + LIST_HEAD_INITIALIZER(fpu_busy_head); +static struct mtx fpu_free_mtx; +static struct mtx fpu_busy_mtx; +#endif + static struct mtx drvdb_mtx; static STAILQ_HEAD(drvdb, drvdb_ent) drvdb_head; @@ -98,6 +115,13 @@ windrv_libinit(void) mtx_init(&drvdb_mtx, "Windows driver DB lock", "Windows internal lock", MTX_DEF); +#ifdef __amd64__ + LIST_INIT(&fpu_free_head); + LIST_INIT(&fpu_busy_head); + mtx_init(&fpu_free_mtx, "free fpu context list lock", NULL, MTX_DEF); + mtx_init(&fpu_busy_mtx, "busy fpu context list lock", NULL, MTX_DEF); +#endif + /* * PCI and pccard devices don't need to use IRPs to * interact with their bus drivers (usually), so our @@ -132,6 +156,9 @@ int windrv_libfini(void) { struct drvdb_ent *d; +#ifdef __amd64__ + struct fpu_cc_ent *ent; +#endif mtx_lock(&drvdb_mtx); while(STAILQ_FIRST(&drvdb_head) != NULL) { @@ -150,6 +177,18 @@ windrv_libfini(void) smp_rendezvous(NULL, x86_oldldt, NULL, NULL); ExFreePool(my_tids); #endif +#ifdef __amd64__ + while ((ent = LIST_FIRST(&fpu_free_head)) != NULL) { + LIST_REMOVE(ent, entries); + fpu_kern_free_ctx(ent->ctx); + free(ent, M_DEVBUF); + } + mtx_destroy(&fpu_free_mtx); + + ent = LIST_FIRST(&fpu_busy_head); + KASSERT(ent == NULL, ("busy fpu context list is not empty")); + mtx_destroy(&fpu_busy_mtx); +#endif return (0); } @@ -614,6 +653,148 @@ windrv_wrap(func, wrap, argcnt, ftype) *wrap = p; return (0); +} + +static struct fpu_cc_ent * +request_fpu_cc_ent(void) +{ + struct fpu_cc_ent *ent; + + mtx_lock(&fpu_free_mtx); + if ((ent = LIST_FIRST(&fpu_free_head)) != NULL) { + LIST_REMOVE(ent, entries); + mtx_unlock(&fpu_free_mtx); + mtx_lock(&fpu_busy_mtx); + LIST_INSERT_HEAD(&fpu_busy_head, ent, entries); + mtx_unlock(&fpu_busy_mtx); + return (ent); + } + mtx_unlock(&fpu_free_mtx); + + if ((ent = malloc(sizeof(struct fpu_cc_ent), M_DEVBUF, M_NOWAIT | + M_ZERO)) != NULL) { + ent->ctx = fpu_kern_alloc_ctx(FPU_KERN_NORMAL | + FPU_KERN_NOWAIT); + if (ent->ctx != NULL) { + mtx_lock(&fpu_busy_mtx); + LIST_INSERT_HEAD(&fpu_busy_head, ent, entries); + mtx_unlock(&fpu_busy_mtx); + } else { + free(ent, M_DEVBUF); + ent = NULL; + } + } + + return (ent); +} + +static void +release_fpu_cc_ent(struct fpu_cc_ent *ent) +{ + mtx_lock(&fpu_busy_mtx); + LIST_REMOVE(ent, entries); + mtx_unlock(&fpu_busy_mtx); + mtx_lock(&fpu_free_mtx); + LIST_INSERT_HEAD(&fpu_free_head, ent, entries); + mtx_unlock(&fpu_free_mtx); +} + +uint64_t +_x86_64_call1(void *fn, uint64_t a) +{ + struct fpu_cc_ent *ent; + uint64_t ret; + + if ((ent = request_fpu_cc_ent()) == NULL) + return (ENOMEM); + fpu_kern_enter(curthread, ent->ctx, FPU_KERN_NORMAL); + ret = x86_64_call1(fn, a); + fpu_kern_leave(curthread, ent->ctx); + release_fpu_cc_ent(ent); + + return (ret); +} + +uint64_t +_x86_64_call2(void *fn, uint64_t a, uint64_t b) +{ + struct fpu_cc_ent *ent; + uint64_t ret; + + if ((ent = request_fpu_cc_ent()) == NULL) + return (ENOMEM); + fpu_kern_enter(curthread, ent->ctx, FPU_KERN_NORMAL); + ret = x86_64_call2(fn, a, b); + fpu_kern_leave(curthread, ent->ctx); + release_fpu_cc_ent(ent); + + return (ret); +} + +uint64_t +_x86_64_call3(void *fn, uint64_t a, uint64_t b, uint64_t c) +{ + struct fpu_cc_ent *ent; + uint64_t ret; + + if ((ent = request_fpu_cc_ent()) == NULL) + return (ENOMEM); + fpu_kern_enter(curthread, ent->ctx, FPU_KERN_NORMAL); + ret = x86_64_call3(fn, a, b, c); + fpu_kern_leave(curthread, ent->ctx); + release_fpu_cc_ent(ent); + + return (ret); +} + +uint64_t +_x86_64_call4(void *fn, uint64_t a, uint64_t b, uint64_t c, uint64_t d) +{ + struct fpu_cc_ent *ent; + uint64_t ret; + + if ((ent = request_fpu_cc_ent()) == NULL) + return (ENOMEM); + fpu_kern_enter(curthread, ent->ctx, FPU_KERN_NORMAL); + ret = x86_64_call4(fn, a, b, c, d); + fpu_kern_leave(curthread, ent->ctx); + release_fpu_cc_ent(ent); + + return (ret); +} + +uint64_t +_x86_64_call5(void *fn, uint64_t a, uint64_t b, uint64_t c, uint64_t d, + uint64_t e) +{ + struct fpu_cc_ent *ent; + uint64_t ret; + + if ((ent = request_fpu_cc_ent()) == NULL) + return (ENOMEM); + fpu_kern_enter(curthread, ent->ctx, FPU_KERN_NORMAL); + ret = x86_64_call5(fn, a, b, c, d, e); + fpu_kern_leave(curthread, ent->ctx); + release_fpu_cc_ent(ent); + + return (ret); +} + +uint64_t +_x86_64_call6(void *fn, uint64_t a, uint64_t b, uint64_t c, uint64_t d, + uint64_t e, uint64_t f) +{ + struct fpu_cc_ent *ent; + uint64_t ret; + + if ((ent = request_fpu_cc_ent()) == NULL) + return (ENOMEM); + fpu_kern_enter(curthread, ent->ctx, FPU_KERN_NORMAL); + ret = x86_64_call6(fn, a, b, c, d, e, f); + fpu_kern_leave(curthread, ent->ctx); + release_fpu_cc_ent(ent); + + return (ret); } #endif /* __amd64__ */ Modified: stable/12/sys/compat/ndis/pe_var.h ============================================================================== --- stable/12/sys/compat/ndis/pe_var.h Sat Mar 23 21:36:59 2019 (r345458) +++ stable/12/sys/compat/ndis/pe_var.h Sat Mar 23 22:44:11 2019 (r345459) @@ -460,22 +460,30 @@ extern uint64_t x86_64_call5(void *, uint64_t, uint64_ extern uint64_t x86_64_call6(void *, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t); +uint64_t _x86_64_call1(void *, uint64_t); +uint64_t _x86_64_call2(void *, uint64_t, uint64_t); +uint64_t _x86_64_call3(void *, uint64_t, uint64_t, uint64_t); +uint64_t _x86_64_call4(void *, uint64_t, uint64_t, uint64_t, uint64_t); +uint64_t _x86_64_call5(void *, uint64_t, uint64_t, uint64_t, uint64_t, + uint64_t); +uint64_t _x86_64_call6(void *, uint64_t, uint64_t, uint64_t, uint64_t, + uint64_t, uint64_t); #define MSCALL1(fn, a) \ - x86_64_call1((fn), (uint64_t)(a)) + _x86_64_call1((fn), (uint64_t)(a)) #define MSCALL2(fn, a, b) \ - x86_64_call2((fn), (uint64_t)(a), (uint64_t)(b)) + _x86_64_call2((fn), (uint64_t)(a), (uint64_t)(b)) #define MSCALL3(fn, a, b, c) \ - x86_64_call3((fn), (uint64_t)(a), (uint64_t)(b), \ + _x86_64_call3((fn), (uint64_t)(a), (uint64_t)(b), \ (uint64_t)(c)) #define MSCALL4(fn, a, b, c, d) \ - x86_64_call4((fn), (uint64_t)(a), (uint64_t)(b), \ + _x86_64_call4((fn), (uint64_t)(a), (uint64_t)(b), \ (uint64_t)(c), (uint64_t)(d)) #define MSCALL5(fn, a, b, c, d, e) \ - x86_64_call5((fn), (uint64_t)(a), (uint64_t)(b), \ + _x86_64_call5((fn), (uint64_t)(a), (uint64_t)(b), \ (uint64_t)(c), (uint64_t)(d), (uint64_t)(e)) #define MSCALL6(fn, a, b, c, d, e, f) \ - x86_64_call6((fn), (uint64_t)(a), (uint64_t)(b), \ + _x86_64_call6((fn), (uint64_t)(a), (uint64_t)(b), \ (uint64_t)(c), (uint64_t)(d), (uint64_t)(e), (uint64_t)(f)) #endif /* __amd64__ */ From owner-svn-src-stable-12@freebsd.org Sat Mar 23 23:43:34 2019 Return-Path: Delivered-To: svn-src-stable-12@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 638F61560EFE; Sat, 23 Mar 2019 23:43:34 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F17A488965; Sat, 23 Mar 2019 23:43:33 +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 E46A6FC18; Sat, 23 Mar 2019 23:43:33 +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 x2NNhXj2010433; Sat, 23 Mar 2019 23:43:33 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2NNhXsB010432; Sat, 23 Mar 2019 23:43:33 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201903232343.x2NNhXsB010432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sat, 23 Mar 2019 23:43:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345462 - stable/12/sys/dev/beri/virtio X-SVN-Group: stable-12 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: stable/12/sys/dev/beri/virtio X-SVN-Commit-Revision: 345462 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F17A488965 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.940,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Mar 2019 23:43:34 -0000 Author: gonzo Date: Sat Mar 23 23:43:33 2019 New Revision: 345462 URL: https://svnweb.freebsd.org/changeset/base/345462 Log: MFC r343998: Fix off-by-one error in BERI virtio driver The hardcoded ident is exactly 20 bytes long but sprintf adds terminating zero, so there is one byte written out of array bounds.As a fix use strncpy it appends \0 only if space allows and its behavior matches virtio spec: When VIRTIO_BLK_T_GET_ID is issued, the device identifier, up to 20 bytes, is written to the buffer. The identifier should be interpreted as an ascii string. It is terminated with \0, unless it is exactly 20 bytes long. PR: 202298 Reviewed by: br Differential Revision: https://reviews.freebsd.org/D18852 Modified: stable/12/sys/dev/beri/virtio/virtio_block.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/beri/virtio/virtio_block.c ============================================================================== --- stable/12/sys/dev/beri/virtio/virtio_block.c Sat Mar 23 22:56:03 2019 (r345461) +++ stable/12/sys/dev/beri/virtio/virtio_block.c Sat Mar 23 23:43:33 2019 (r345462) @@ -187,7 +187,7 @@ vtblk_proc(struct beri_vtblk_softc *sc, struct vqueue_ break; case VIRTIO_BLK_T_GET_ID: /* Assume a single buffer */ - strlcpy(iov[1].iov_base, sc->ident, + strncpy(iov[1].iov_base, sc->ident, MIN(iov[1].iov_len, sizeof(sc->ident))); err = 0; break; @@ -401,7 +401,7 @@ backend_info(struct beri_vtblk_softc *sc) s+=1; } - sprintf(sc->ident, "Virtio block backend"); + strncpy(sc->ident, "Virtio block backend", sizeof(sc->ident)); return (0); } From owner-svn-src-stable-12@freebsd.org Sat Mar 23 23:44:41 2019 Return-Path: Delivered-To: svn-src-stable-12@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 649D51560F7A; Sat, 23 Mar 2019 23:44:41 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 03D2588ABA; Sat, 23 Mar 2019 23:44:41 +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 CA589FC1B; Sat, 23 Mar 2019 23:44:40 +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 x2NNie9x010570; Sat, 23 Mar 2019 23:44:40 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2NNie2t010569; Sat, 23 Mar 2019 23:44:40 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201903232344.x2NNie2t010569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sat, 23 Mar 2019 23:44:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345463 - stable/12/share/examples/kld/dyn_sysctl X-SVN-Group: stable-12 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: stable/12/share/examples/kld/dyn_sysctl X-SVN-Commit-Revision: 345463 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 03D2588ABA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.940,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Mar 2019 23:44:41 -0000 Author: gonzo Date: Sat Mar 23 23:44:40 2019 New Revision: 345463 URL: https://svnweb.freebsd.org/changeset/base/345463 Log: MFC r345220: Fix build for KLD dyn_sysctl example Looks like the example was broken by change of SYSCTL_STATIC_CHILDREN definition in r267992. Fix build by switching to using SYSCTL_ADD_ROOT_NODE PR: 236139 Submitted by: Andrew Reiter Modified: stable/12/share/examples/kld/dyn_sysctl/dyn_sysctl.c Directory Properties: stable/12/ (props changed) Modified: stable/12/share/examples/kld/dyn_sysctl/dyn_sysctl.c ============================================================================== --- stable/12/share/examples/kld/dyn_sysctl/dyn_sysctl.c Sat Mar 23 23:43:33 2019 (r345462) +++ stable/12/share/examples/kld/dyn_sysctl/dyn_sysctl.c Sat Mar 23 23:44:40 2019 (r345463) @@ -72,12 +72,10 @@ load(module_t mod, int cmd, void *arg) * to different contexts. */ printf("TREE ROOT NAME\n"); - a_root = SYSCTL_ADD_NODE(&clist, - SYSCTL_STATIC_CHILDREN(/* top of sysctl tree */), + a_root = SYSCTL_ADD_ROOT_NODE(&clist, OID_AUTO, "dyn_sysctl", CTLFLAG_RW, 0, "dyn_sysctl root node"); - a_root = SYSCTL_ADD_NODE(&clist1, - SYSCTL_STATIC_CHILDREN(/* top of sysctl tree */), + a_root = SYSCTL_ADD_ROOT_NODE(&clist1, OID_AUTO, "dyn_sysctl", CTLFLAG_RW, 0, "dyn_sysctl root node"); if (a_root == NULL) {