Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Jun 2014 01:08:57 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r267034 - in user/cperciva/freebsd-update-build/patches: 10.0-RELEASE 8.4-RELEASE 9.1-RELEASE 9.2-RELEASE
Message-ID:  <201406040108.s5418vFr023739@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: delphij
Date: Wed Jun  4 01:08:57 2014
New Revision: 267034
URL: http://svnweb.freebsd.org/changeset/base/267034

Log:
  Patches for 2014/06/03 batch.

Added:
  user/cperciva/freebsd-update-build/patches/10.0-RELEASE/4-EN-14:06.exec
  user/cperciva/freebsd-update-build/patches/10.0-RELEASE/4-SA-14:11.sendmail
  user/cperciva/freebsd-update-build/patches/10.0-RELEASE/4-SA-14:13.pam
  user/cperciva/freebsd-update-build/patches/8.4-RELEASE/11-EN-14:06.exec
  user/cperciva/freebsd-update-build/patches/8.4-RELEASE/11-SA-14:11.sendmail
  user/cperciva/freebsd-update-build/patches/8.4-RELEASE/11-SA-14:12.ktrace
  user/cperciva/freebsd-update-build/patches/9.1-RELEASE/14-EN-14:06.exec
  user/cperciva/freebsd-update-build/patches/9.1-RELEASE/14-SA-14:11.sendmail
  user/cperciva/freebsd-update-build/patches/9.1-RELEASE/14-SA-14:12.ktrace
  user/cperciva/freebsd-update-build/patches/9.2-RELEASE/7-EN-14:06.exec
  user/cperciva/freebsd-update-build/patches/9.2-RELEASE/7-SA-14:11.sendmail
  user/cperciva/freebsd-update-build/patches/9.2-RELEASE/7-SA-14:12.ktrace
  user/cperciva/freebsd-update-build/patches/9.2-RELEASE/7-SA-14:13.pam

Added: user/cperciva/freebsd-update-build/patches/10.0-RELEASE/4-EN-14:06.exec
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/cperciva/freebsd-update-build/patches/10.0-RELEASE/4-EN-14:06.exec	Wed Jun  4 01:08:57 2014	(r267034)
@@ -0,0 +1,66 @@
+Index: sys/kern/kern_exec.c
+===================================================================
+--- sys/kern/kern_exec.c	(revision 266979)
++++ sys/kern/kern_exec.c	(working copy)
+@@ -283,6 +283,7 @@ kern_execve(td, args, mac_p)
+ 	struct mac *mac_p;
+ {
+ 	struct proc *p = td->td_proc;
++	struct vmspace *oldvmspace;
+ 	int error;
+ 
+ 	AUDIT_ARG_ARGV(args->begin_argv, args->argc,
+@@ -299,6 +300,8 @@ kern_execve(td, args, mac_p)
+ 		PROC_UNLOCK(p);
+ 	}
+ 
++	KASSERT((td->td_pflags & TDP_EXECVMSPC) == 0, ("nested execve"));
++	oldvmspace = td->td_proc->p_vmspace;
+ 	error = do_execve(td, args, mac_p);
+ 
+ 	if (p->p_flag & P_HADTHREADS) {
+@@ -313,6 +316,12 @@ kern_execve(td, args, mac_p)
+ 			thread_single_end();
+ 		PROC_UNLOCK(p);
+ 	}
++	if ((td->td_pflags & TDP_EXECVMSPC) != 0) {
++		KASSERT(td->td_proc->p_vmspace != oldvmspace,
++		    ("oldvmspace still used"));
++		vmspace_free(oldvmspace);
++		td->td_pflags &= ~TDP_EXECVMSPC;
++	}
+ 
+ 	return (error);
+ }
+Index: sys/sys/proc.h
+===================================================================
+--- sys/sys/proc.h	(revision 266979)
++++ sys/sys/proc.h	(working copy)
+@@ -966,4 +966,5 @@ curthread_pflags_restore(int save)
+ 
+ #endif	/* _KERNEL */
+ 
++#define	TDP_EXECVMSPC	0x40000000 /* Execve destroyed old vmspace */
+ #endif	/* !_SYS_PROC_H_ */
+Index: sys/vm/vm_map.c
+===================================================================
+--- sys/vm/vm_map.c	(revision 266979)
++++ sys/vm/vm_map.c	(working copy)
+@@ -3725,6 +3725,8 @@ vmspace_exec(struct proc *p, vm_offset_t minuser,
+ 	struct vmspace *oldvmspace = p->p_vmspace;
+ 	struct vmspace *newvmspace;
+ 
++	KASSERT((curthread->td_pflags & TDP_EXECVMSPC) == 0,
++	    ("vmspace_exec recursed"));
+ 	newvmspace = vmspace_alloc(minuser, maxuser, NULL);
+ 	if (newvmspace == NULL)
+ 		return (ENOMEM);
+@@ -3741,7 +3743,7 @@ vmspace_exec(struct proc *p, vm_offset_t minuser,
+ 	PROC_VMSPACE_UNLOCK(p);
+ 	if (p == curthread->td_proc)
+ 		pmap_activate(curthread);
+-	vmspace_free(oldvmspace);
++	curthread->td_pflags |= TDP_EXECVMSPC;
+ 	return (0);
+ }
+ 

Added: user/cperciva/freebsd-update-build/patches/10.0-RELEASE/4-SA-14:11.sendmail
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/cperciva/freebsd-update-build/patches/10.0-RELEASE/4-SA-14:11.sendmail	Wed Jun  4 01:08:57 2014	(r267034)
@@ -0,0 +1,15 @@
+Index: contrib/sendmail/src/conf.c
+===================================================================
+--- contrib/sendmail/src/conf.c	(revision 266538)
++++ contrib/sendmail/src/conf.c	(working copy)
+@@ -5309,8 +5309,8 @@ closefd_walk(lowest, fd)
+ */
+ 
+ void
+-sm_close_on_exec(highest, lowest)
+-	int highest, lowest;
++sm_close_on_exec(lowest, highest)
++	int lowest, highest;
+ {
+ #if HASFDWALK
+ 	(void) fdwalk(closefd_walk, &lowest);

Added: user/cperciva/freebsd-update-build/patches/10.0-RELEASE/4-SA-14:13.pam
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/cperciva/freebsd-update-build/patches/10.0-RELEASE/4-SA-14:13.pam	Wed Jun  4 01:08:57 2014	(r267034)
@@ -0,0 +1,126 @@
+Index: contrib/openpam/lib/libpam/openpam_configure.c
+===================================================================
+--- contrib/openpam/lib/libpam/openpam_configure.c.orig
++++ contrib/openpam/lib/libpam/openpam_configure.c
+@@ -1,6 +1,6 @@
+ /*-
+  * Copyright (c) 2001-2003 Networks Associates Technology, Inc.
+- * Copyright (c) 2004-2012 Dag-Erling Smørgrav
++ * Copyright (c) 2004-2014 Dag-Erling Smørgrav
+  * All rights reserved.
+  *
+  * This software was developed for the FreeBSD Project by ThinkSec AS and
+@@ -193,6 +193,7 @@
+ 			openpam_log(PAM_LOG_ERROR,
+ 			    "%s(%d): missing or invalid facility",
+ 			    filename, lineno);
++			errno = EINVAL;
+ 			goto fail;
+ 		}
+ 		if (facility != fclt && facility != PAM_FACILITY_ANY) {
+@@ -208,6 +209,7 @@
+ 				openpam_log(PAM_LOG_ERROR,
+ 				    "%s(%d): missing or invalid service name",
+ 				    filename, lineno);
++				errno = EINVAL;
+ 				goto fail;
+ 			}
+ 			if (wordv[i] != NULL) {
+@@ -214,12 +216,21 @@
+ 				openpam_log(PAM_LOG_ERROR,
+ 				    "%s(%d): garbage at end of line",
+ 				    filename, lineno);
++				errno = EINVAL;
+ 				goto fail;
+ 			}
+ 			ret = openpam_load_chain(pamh, servicename, fclt);
+ 			FREEV(wordc, wordv);
+-			if (ret < 0)
++			if (ret < 0) {
++				/*
++				 * Bogus errno, but this ensures that the
++				 * outer loop does not just ignore the
++				 * error and keep searching.
++				 */
++				if (errno == ENOENT)
++					errno = EINVAL;
+ 				goto fail;
++			}
+ 			continue;
+ 		}
+ 
+@@ -229,6 +240,7 @@
+ 			openpam_log(PAM_LOG_ERROR,
+ 			    "%s(%d): missing or invalid control flag",
+ 			    filename, lineno);
++			errno = EINVAL;
+ 			goto fail;
+ 		}
+ 
+@@ -238,6 +250,7 @@
+ 			openpam_log(PAM_LOG_ERROR,
+ 			    "%s(%d): missing or invalid module name",
+ 			    filename, lineno);
++			errno = EINVAL;
+ 			goto fail;
+ 		}
+ 
+@@ -247,8 +260,11 @@
+ 		this->flag = ctlf;
+ 
+ 		/* load module */
+-		if ((this->module = openpam_load_module(modulename)) == NULL)
++		if ((this->module = openpam_load_module(modulename)) == NULL) {
++			if (errno == ENOENT)
++				errno = ENOEXEC;
+ 			goto fail;
++		}
+ 
+ 		/*
+ 		 * The remaining items in wordv are the module's
+@@ -281,7 +297,11 @@
+ 	 * The loop ended because openpam_readword() returned NULL, which
+ 	 * can happen for four different reasons: an I/O error (ferror(f)
+ 	 * is true), a memory allocation failure (ferror(f) is false,
+-	 * errno is non-zero)
++	 * feof(f) is false, errno is non-zero), the file ended with an
++	 * unterminated quote or backslash escape (ferror(f) is false,
++	 * feof(f) is true, errno is non-zero), or the end of the file was
++	 * reached without error (ferror(f) is false, feof(f) is true,
++	 * errno is zero).
+ 	 */
+ 	if (ferror(f) || errno != 0)
+ 		goto syserr;
+@@ -402,6 +422,9 @@
+ 		}
+ 		ret = openpam_load_file(pamh, service, facility,
+ 		    filename, style);
++		/* success */
++		if (ret > 0)
++			RETURNN(ret);
+ 		/* the file exists, but an error occurred */
+ 		if (ret == -1 && errno != ENOENT)
+ 			RETURNN(ret);
+@@ -411,7 +434,8 @@
+ 	}
+ 
+ 	/* no hit */
+-	RETURNN(0);
++	errno = ENOENT;
++	RETURNN(-1);
+ }
+ 
+ /*
+@@ -432,8 +456,10 @@
+ 		openpam_log(PAM_LOG_ERROR, "invalid service name");
+ 		RETURNC(PAM_SYSTEM_ERR);
+ 	}
+-	if (openpam_load_chain(pamh, service, PAM_FACILITY_ANY) < 0)
+-		goto load_err;
++	if (openpam_load_chain(pamh, service, PAM_FACILITY_ANY) < 0) {
++		if (errno != ENOENT)
++			goto load_err;
++	}
+ 	for (fclt = 0; fclt < PAM_NUM_FACILITIES; ++fclt) {
+ 		if (pamh->chains[fclt] != NULL)
+ 			continue;

Added: user/cperciva/freebsd-update-build/patches/8.4-RELEASE/11-EN-14:06.exec
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/cperciva/freebsd-update-build/patches/8.4-RELEASE/11-EN-14:06.exec	Wed Jun  4 01:08:57 2014	(r267034)
@@ -0,0 +1,66 @@
+Index: sys/kern/kern_exec.c
+===================================================================
+--- sys/kern/kern_exec.c	(revision 266979)
++++ sys/kern/kern_exec.c	(working copy)
+@@ -278,6 +278,7 @@ kern_execve(td, args, mac_p)
+ 	struct mac *mac_p;
+ {
+ 	struct proc *p = td->td_proc;
++	struct vmspace *oldvmspace;
+ 	int error;
+ 
+ 	AUDIT_ARG_ARGV(args->begin_argv, args->argc,
+@@ -294,6 +295,8 @@ kern_execve(td, args, mac_p)
+ 		PROC_UNLOCK(p);
+ 	}
+ 
++	KASSERT((td->td_pflags & TDP_EXECVMSPC) == 0, ("nested execve"));
++	oldvmspace = td->td_proc->p_vmspace;
+ 	error = do_execve(td, args, mac_p);
+ 
+ 	if (p->p_flag & P_HADTHREADS) {
+@@ -308,6 +311,12 @@ kern_execve(td, args, mac_p)
+ 			thread_single_end();
+ 		PROC_UNLOCK(p);
+ 	}
++	if ((td->td_pflags & TDP_EXECVMSPC) != 0) {
++		KASSERT(td->td_proc->p_vmspace != oldvmspace,
++		    ("oldvmspace still used"));
++		vmspace_free(oldvmspace);
++		td->td_pflags &= ~TDP_EXECVMSPC;
++	}
+ 
+ 	return (error);
+ }
+Index: sys/sys/proc.h
+===================================================================
+--- sys/sys/proc.h	(revision 266979)
++++ sys/sys/proc.h	(working copy)
+@@ -938,4 +938,5 @@ curthread_pflags_restore(int save)
+ 
+ #endif	/* _KERNEL */
+ 
++#define	TDP_EXECVMSPC	0x40000000 /* Execve destroyed old vmspace */
+ #endif	/* !_SYS_PROC_H_ */
+Index: sys/vm/vm_map.c
+===================================================================
+--- sys/vm/vm_map.c	(revision 266979)
++++ sys/vm/vm_map.c	(working copy)
+@@ -3521,6 +3521,8 @@ vmspace_exec(struct proc *p, vm_offset_t minuser,
+ 	struct vmspace *oldvmspace = p->p_vmspace;
+ 	struct vmspace *newvmspace;
+ 
++	KASSERT((curthread->td_pflags & TDP_EXECVMSPC) == 0,
++	    ("vmspace_exec recursed"));
+ 	newvmspace = vmspace_alloc(minuser, maxuser);
+ 	if (newvmspace == NULL)
+ 		return (ENOMEM);
+@@ -3537,7 +3539,7 @@ vmspace_exec(struct proc *p, vm_offset_t minuser,
+ 	PROC_VMSPACE_UNLOCK(p);
+ 	if (p == curthread->td_proc)
+ 		pmap_activate(curthread);
+-	vmspace_free(oldvmspace);
++	curthread->td_pflags |= TDP_EXECVMSPC;
+ 	return (0);
+ }
+ 

Added: user/cperciva/freebsd-update-build/patches/8.4-RELEASE/11-SA-14:11.sendmail
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/cperciva/freebsd-update-build/patches/8.4-RELEASE/11-SA-14:11.sendmail	Wed Jun  4 01:08:57 2014	(r267034)
@@ -0,0 +1,15 @@
+Index: contrib/sendmail/src/conf.c
+===================================================================
+--- contrib/sendmail/src/conf.c	(revision 266538)
++++ contrib/sendmail/src/conf.c	(working copy)
+@@ -5309,8 +5309,8 @@ closefd_walk(lowest, fd)
+ */
+ 
+ void
+-sm_close_on_exec(highest, lowest)
+-	int highest, lowest;
++sm_close_on_exec(lowest, highest)
++	int lowest, highest;
+ {
+ #if HASFDWALK
+ 	(void) fdwalk(closefd_walk, &lowest);

Added: user/cperciva/freebsd-update-build/patches/8.4-RELEASE/11-SA-14:12.ktrace
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/cperciva/freebsd-update-build/patches/8.4-RELEASE/11-SA-14:12.ktrace	Wed Jun  4 01:08:57 2014	(r267034)
@@ -0,0 +1,12 @@
+Index: sys/kern/kern_ktrace.c
+===================================================================
+--- sys/kern/kern_ktrace.c	(revision 266771)
++++ sys/kern/kern_ktrace.c	(working copy)
+@@ -119,6 +119,7 @@ static int data_lengths[] = {
+ 	0,					/* KTR_SYSCTL */
+ 	sizeof(struct ktr_proc_ctor),		/* KTR_PROCCTOR */
+ 	0,					/* KTR_PROCDTOR */
++	0,					/* unused */
+ 	sizeof(struct ktr_fault),		/* KTR_FAULT */
+ 	sizeof(struct ktr_faultend),		/* KTR_FAULTEND */
+ };

Added: user/cperciva/freebsd-update-build/patches/9.1-RELEASE/14-EN-14:06.exec
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/cperciva/freebsd-update-build/patches/9.1-RELEASE/14-EN-14:06.exec	Wed Jun  4 01:08:57 2014	(r267034)
@@ -0,0 +1,66 @@
+Index: sys/kern/kern_exec.c
+===================================================================
+--- sys/kern/kern_exec.c	(revision 266979)
++++ sys/kern/kern_exec.c	(working copy)
+@@ -280,6 +280,7 @@ kern_execve(td, args, mac_p)
+ 	struct mac *mac_p;
+ {
+ 	struct proc *p = td->td_proc;
++	struct vmspace *oldvmspace;
+ 	int error;
+ 
+ 	AUDIT_ARG_ARGV(args->begin_argv, args->argc,
+@@ -296,6 +297,8 @@ kern_execve(td, args, mac_p)
+ 		PROC_UNLOCK(p);
+ 	}
+ 
++	KASSERT((td->td_pflags & TDP_EXECVMSPC) == 0, ("nested execve"));
++	oldvmspace = td->td_proc->p_vmspace;
+ 	error = do_execve(td, args, mac_p);
+ 
+ 	if (p->p_flag & P_HADTHREADS) {
+@@ -310,6 +313,12 @@ kern_execve(td, args, mac_p)
+ 			thread_single_end();
+ 		PROC_UNLOCK(p);
+ 	}
++	if ((td->td_pflags & TDP_EXECVMSPC) != 0) {
++		KASSERT(td->td_proc->p_vmspace != oldvmspace,
++		    ("oldvmspace still used"));
++		vmspace_free(oldvmspace);
++		td->td_pflags &= ~TDP_EXECVMSPC;
++	}
+ 
+ 	return (error);
+ }
+Index: sys/sys/proc.h
+===================================================================
+--- sys/sys/proc.h	(revision 266979)
++++ sys/sys/proc.h	(working copy)
+@@ -968,4 +968,5 @@ curthread_pflags_restore(int save)
+ 
+ #endif	/* _KERNEL */
+ 
++#define	TDP_EXECVMSPC	0x40000000 /* Execve destroyed old vmspace */
+ #endif	/* !_SYS_PROC_H_ */
+Index: sys/vm/vm_map.c
+===================================================================
+--- sys/vm/vm_map.c	(revision 266979)
++++ sys/vm/vm_map.c	(working copy)
+@@ -3631,6 +3631,8 @@ vmspace_exec(struct proc *p, vm_offset_t minuser,
+ 	struct vmspace *oldvmspace = p->p_vmspace;
+ 	struct vmspace *newvmspace;
+ 
++	KASSERT((curthread->td_pflags & TDP_EXECVMSPC) == 0,
++	    ("vmspace_exec recursed"));
+ 	newvmspace = vmspace_alloc(minuser, maxuser);
+ 	if (newvmspace == NULL)
+ 		return (ENOMEM);
+@@ -3647,7 +3649,7 @@ vmspace_exec(struct proc *p, vm_offset_t minuser,
+ 	PROC_VMSPACE_UNLOCK(p);
+ 	if (p == curthread->td_proc)
+ 		pmap_activate(curthread);
+-	vmspace_free(oldvmspace);
++	curthread->td_pflags |= TDP_EXECVMSPC;
+ 	return (0);
+ }
+ 

Added: user/cperciva/freebsd-update-build/patches/9.1-RELEASE/14-SA-14:11.sendmail
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/cperciva/freebsd-update-build/patches/9.1-RELEASE/14-SA-14:11.sendmail	Wed Jun  4 01:08:57 2014	(r267034)
@@ -0,0 +1,15 @@
+Index: contrib/sendmail/src/conf.c
+===================================================================
+--- contrib/sendmail/src/conf.c	(revision 266538)
++++ contrib/sendmail/src/conf.c	(working copy)
+@@ -5309,8 +5309,8 @@ closefd_walk(lowest, fd)
+ */
+ 
+ void
+-sm_close_on_exec(highest, lowest)
+-	int highest, lowest;
++sm_close_on_exec(lowest, highest)
++	int lowest, highest;
+ {
+ #if HASFDWALK
+ 	(void) fdwalk(closefd_walk, &lowest);

Added: user/cperciva/freebsd-update-build/patches/9.1-RELEASE/14-SA-14:12.ktrace
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/cperciva/freebsd-update-build/patches/9.1-RELEASE/14-SA-14:12.ktrace	Wed Jun  4 01:08:57 2014	(r267034)
@@ -0,0 +1,12 @@
+Index: sys/kern/kern_ktrace.c
+===================================================================
+--- sys/kern/kern_ktrace.c	(revision 266771)
++++ sys/kern/kern_ktrace.c	(working copy)
+@@ -119,6 +119,7 @@ static int data_lengths[] = {
+ 	0,					/* KTR_SYSCTL */
+ 	sizeof(struct ktr_proc_ctor),		/* KTR_PROCCTOR */
+ 	0,					/* KTR_PROCDTOR */
++	0,					/* unused */
+ 	sizeof(struct ktr_fault),		/* KTR_FAULT */
+ 	sizeof(struct ktr_faultend),		/* KTR_FAULTEND */
+ };

Added: user/cperciva/freebsd-update-build/patches/9.2-RELEASE/7-EN-14:06.exec
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/cperciva/freebsd-update-build/patches/9.2-RELEASE/7-EN-14:06.exec	Wed Jun  4 01:08:57 2014	(r267034)
@@ -0,0 +1,66 @@
+Index: sys/kern/kern_exec.c
+===================================================================
+--- sys/kern/kern_exec.c	(revision 266979)
++++ sys/kern/kern_exec.c	(working copy)
+@@ -280,6 +280,7 @@ kern_execve(td, args, mac_p)
+ 	struct mac *mac_p;
+ {
+ 	struct proc *p = td->td_proc;
++	struct vmspace *oldvmspace;
+ 	int error;
+ 
+ 	AUDIT_ARG_ARGV(args->begin_argv, args->argc,
+@@ -296,6 +297,8 @@ kern_execve(td, args, mac_p)
+ 		PROC_UNLOCK(p);
+ 	}
+ 
++	KASSERT((td->td_pflags & TDP_EXECVMSPC) == 0, ("nested execve"));
++	oldvmspace = td->td_proc->p_vmspace;
+ 	error = do_execve(td, args, mac_p);
+ 
+ 	if (p->p_flag & P_HADTHREADS) {
+@@ -310,6 +313,12 @@ kern_execve(td, args, mac_p)
+ 			thread_single_end();
+ 		PROC_UNLOCK(p);
+ 	}
++	if ((td->td_pflags & TDP_EXECVMSPC) != 0) {
++		KASSERT(td->td_proc->p_vmspace != oldvmspace,
++		    ("oldvmspace still used"));
++		vmspace_free(oldvmspace);
++		td->td_pflags &= ~TDP_EXECVMSPC;
++	}
+ 
+ 	return (error);
+ }
+Index: sys/sys/proc.h
+===================================================================
+--- sys/sys/proc.h	(revision 266979)
++++ sys/sys/proc.h	(working copy)
+@@ -977,4 +977,5 @@ curthread_pflags_restore(int save)
+ 
+ #endif	/* _KERNEL */
+ 
++#define	TDP_EXECVMSPC	0x40000000 /* Execve destroyed old vmspace */
+ #endif	/* !_SYS_PROC_H_ */
+Index: sys/vm/vm_map.c
+===================================================================
+--- sys/vm/vm_map.c	(revision 266979)
++++ sys/vm/vm_map.c	(working copy)
+@@ -3669,6 +3669,8 @@ vmspace_exec(struct proc *p, vm_offset_t minuser,
+ 	struct vmspace *oldvmspace = p->p_vmspace;
+ 	struct vmspace *newvmspace;
+ 
++	KASSERT((curthread->td_pflags & TDP_EXECVMSPC) == 0,
++	    ("vmspace_exec recursed"));
+ 	newvmspace = vmspace_alloc(minuser, maxuser);
+ 	if (newvmspace == NULL)
+ 		return (ENOMEM);
+@@ -3685,7 +3687,7 @@ vmspace_exec(struct proc *p, vm_offset_t minuser,
+ 	PROC_VMSPACE_UNLOCK(p);
+ 	if (p == curthread->td_proc)
+ 		pmap_activate(curthread);
+-	vmspace_free(oldvmspace);
++	curthread->td_pflags |= TDP_EXECVMSPC;
+ 	return (0);
+ }
+ 

Added: user/cperciva/freebsd-update-build/patches/9.2-RELEASE/7-SA-14:11.sendmail
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/cperciva/freebsd-update-build/patches/9.2-RELEASE/7-SA-14:11.sendmail	Wed Jun  4 01:08:57 2014	(r267034)
@@ -0,0 +1,15 @@
+Index: contrib/sendmail/src/conf.c
+===================================================================
+--- contrib/sendmail/src/conf.c	(revision 266538)
++++ contrib/sendmail/src/conf.c	(working copy)
+@@ -5309,8 +5309,8 @@ closefd_walk(lowest, fd)
+ */
+ 
+ void
+-sm_close_on_exec(highest, lowest)
+-	int highest, lowest;
++sm_close_on_exec(lowest, highest)
++	int lowest, highest;
+ {
+ #if HASFDWALK
+ 	(void) fdwalk(closefd_walk, &lowest);

Added: user/cperciva/freebsd-update-build/patches/9.2-RELEASE/7-SA-14:12.ktrace
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/cperciva/freebsd-update-build/patches/9.2-RELEASE/7-SA-14:12.ktrace	Wed Jun  4 01:08:57 2014	(r267034)
@@ -0,0 +1,12 @@
+Index: sys/kern/kern_ktrace.c
+===================================================================
+--- sys/kern/kern_ktrace.c	(revision 266771)
++++ sys/kern/kern_ktrace.c	(working copy)
+@@ -119,6 +119,7 @@ static int data_lengths[] = {
+ 	0,					/* KTR_SYSCTL */
+ 	sizeof(struct ktr_proc_ctor),		/* KTR_PROCCTOR */
+ 	0,					/* KTR_PROCDTOR */
++	0,					/* unused */
+ 	sizeof(struct ktr_fault),		/* KTR_FAULT */
+ 	sizeof(struct ktr_faultend),		/* KTR_FAULTEND */
+ };

Added: user/cperciva/freebsd-update-build/patches/9.2-RELEASE/7-SA-14:13.pam
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/cperciva/freebsd-update-build/patches/9.2-RELEASE/7-SA-14:13.pam	Wed Jun  4 01:08:57 2014	(r267034)
@@ -0,0 +1,126 @@
+Index: contrib/openpam/lib/openpam_configure.c
+===================================================================
+--- contrib/openpam/lib/openpam_configure.c.orig
++++ contrib/openpam/lib/openpam_configure.c
+@@ -1,6 +1,6 @@
+ /*-
+  * Copyright (c) 2001-2003 Networks Associates Technology, Inc.
+- * Copyright (c) 2004-2012 Dag-Erling Smørgrav
++ * Copyright (c) 2004-2014 Dag-Erling Smørgrav
+  * All rights reserved.
+  *
+  * This software was developed for the FreeBSD Project by ThinkSec AS and
+@@ -194,6 +194,7 @@
+ 			openpam_log(PAM_LOG_ERROR,
+ 			    "%s(%d): missing or invalid facility",
+ 			    filename, lineno);
++			errno = EINVAL;
+ 			goto fail;
+ 		}
+ 		if (facility != fclt && facility != PAM_FACILITY_ANY) {
+@@ -209,6 +210,7 @@
+ 				openpam_log(PAM_LOG_ERROR,
+ 				    "%s(%d): missing or invalid service name",
+ 				    filename, lineno);
++				errno = EINVAL;
+ 				goto fail;
+ 			}
+ 			if (wordv[i] != NULL) {
+@@ -215,12 +217,21 @@
+ 				openpam_log(PAM_LOG_ERROR,
+ 				    "%s(%d): garbage at end of line",
+ 				    filename, lineno);
++				errno = EINVAL;
+ 				goto fail;
+ 			}
+ 			ret = openpam_load_chain(pamh, servicename, fclt);
+ 			FREEV(wordc, wordv);
+-			if (ret < 0)
++			if (ret < 0) {
++				/*
++				 * Bogus errno, but this ensures that the
++				 * outer loop does not just ignore the
++				 * error and keep searching.
++				 */
++				if (errno == ENOENT)
++					errno = EINVAL;
+ 				goto fail;
++			}
+ 			continue;
+ 		}
+ 
+@@ -230,6 +241,7 @@
+ 			openpam_log(PAM_LOG_ERROR,
+ 			    "%s(%d): missing or invalid control flag",
+ 			    filename, lineno);
++			errno = EINVAL;
+ 			goto fail;
+ 		}
+ 
+@@ -239,6 +251,7 @@
+ 			openpam_log(PAM_LOG_ERROR,
+ 			    "%s(%d): missing or invalid module name",
+ 			    filename, lineno);
++			errno = EINVAL;
+ 			goto fail;
+ 		}
+ 
+@@ -248,8 +261,11 @@
+ 		this->flag = ctlf;
+ 
+ 		/* load module */
+-		if ((this->module = openpam_load_module(modulename)) == NULL)
++		if ((this->module = openpam_load_module(modulename)) == NULL) {
++			if (errno == ENOENT)
++				errno = ENOEXEC;
+ 			goto fail;
++		}
+ 
+ 		/*
+ 		 * The remaining items in wordv are the module's
+@@ -282,7 +298,11 @@
+ 	 * The loop ended because openpam_readword() returned NULL, which
+ 	 * can happen for four different reasons: an I/O error (ferror(f)
+ 	 * is true), a memory allocation failure (ferror(f) is false,
+-	 * errno is non-zero)
++	 * feof(f) is false, errno is non-zero), the file ended with an
++	 * unterminated quote or backslash escape (ferror(f) is false,
++	 * feof(f) is true, errno is non-zero), or the end of the file was
++	 * reached without error (ferror(f) is false, feof(f) is true,
++	 * errno is zero).
+ 	 */
+ 	if (ferror(f) || errno != 0)
+ 		goto syserr;
+@@ -411,6 +431,9 @@
+ 		}
+ 		ret = openpam_load_file(pamh, service, facility,
+ 		    filename, style);
++		/* success */
++		if (ret > 0)
++			RETURNN(ret);
+ 		/* the file exists, but an error occurred */
+ 		if (ret == -1 && errno != ENOENT)
+ 			RETURNN(ret);
+@@ -420,7 +443,8 @@
+ 	}
+ 
+ 	/* no hit */
+-	RETURNN(0);
++	errno = ENOENT;
++	RETURNN(-1);
+ }
+ 
+ /*
+@@ -441,8 +465,10 @@
+ 		openpam_log(PAM_LOG_ERROR, "invalid service name");
+ 		RETURNC(PAM_SYSTEM_ERR);
+ 	}
+-	if (openpam_load_chain(pamh, service, PAM_FACILITY_ANY) < 0)
+-		goto load_err;
++	if (openpam_load_chain(pamh, service, PAM_FACILITY_ANY) < 0) {
++		if (errno != ENOENT)
++			goto load_err;
++	}
+ 	for (fclt = 0; fclt < PAM_NUM_FACILITIES; ++fclt) {
+ 		if (pamh->chains[fclt] != NULL)
+ 			continue;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201406040108.s5418vFr023739>