[Glibc-bsd-commits] r5475 - in trunk/kfreebsd-10/debian: . patches

stevenc-guest at alioth.debian.org stevenc-guest at alioth.debian.org
Tue May 20 12:23:11 UTC 2014


Author: stevenc-guest
Date: 2014-05-20 12:23:11 +0000 (Tue, 20 May 2014)
New Revision: 5475

Added:
   trunk/kfreebsd-10/debian/patches/EN-14_05.ciss.patch
   trunk/kfreebsd-10/debian/patches/EN-14_06.execve.patch
Removed:
   trunk/kfreebsd-10/debian/patches/EN-14_05.execve.patch
Modified:
   trunk/kfreebsd-10/debian/changelog
   trunk/kfreebsd-10/debian/patches/series
Log:
Pick SVN 264510 from FreeBSD 10-STABLE to fix EN-14:05:
ciss(4) potential data corruption bug (Closes: #748079)


Modified: trunk/kfreebsd-10/debian/changelog
===================================================================
--- trunk/kfreebsd-10/debian/changelog	2014-05-20 12:14:02 UTC (rev 5474)
+++ trunk/kfreebsd-10/debian/changelog	2014-05-20 12:23:11 UTC (rev 5475)
@@ -1,9 +1,11 @@
 kfreebsd-10 (10.0-6) UNRELEASED; urgency=high
 
   * Team upload.
-  * Pick SVN 266464 from FreeBSD CURRENT to fix EN-14:05:
+  * Pick SVN 264510 from FreeBSD 10-STABLE to fix EN-14:05:
+    ciss(4) potential data corruption bug (Closes: #748079)
+  * Pick SVN 266464 from FreeBSD CURRENT to fix EN-14:06:
     Triple fault on execve from 64-bit thread to 32-bit process
-    (Closes: Bug#748744)
+    (Closes: #748744)
 
  -- Steven Chamberlain <steven at pyro.eu.org>  Tue, 20 May 2014 12:47:21 +0100
 

Added: trunk/kfreebsd-10/debian/patches/EN-14_05.ciss.patch
===================================================================
--- trunk/kfreebsd-10/debian/patches/EN-14_05.ciss.patch	                        (rev 0)
+++ trunk/kfreebsd-10/debian/patches/EN-14_05.ciss.patch	2014-05-20 12:23:11 UTC (rev 5475)
@@ -0,0 +1,74 @@
+Index: sys/dev/ciss/ciss.c
+===================================================================
+--- sys/dev/ciss/ciss.c	(revision 264509)
++++ sys/dev/ciss/ciss.c	(revision 264510)
+@@ -180,8 +180,6 @@
+ static void	ciss_cam_poll(struct cam_sim *sim);
+ static void	ciss_cam_complete(struct ciss_request *cr);
+ static void	ciss_cam_complete_fixup(struct ciss_softc *sc, struct ccb_scsiio *csio);
+-static struct cam_periph *ciss_find_periph(struct ciss_softc *sc,
+-					   int bus, int target);
+ static int	ciss_name_device(struct ciss_softc *sc, int bus, int target);
+ 
+ /* periodic status monitoring */
+@@ -3398,27 +3396,6 @@
+ 
+ 
+ /********************************************************************************
+- * Find a peripheral attached at (target)
+- */
+-static struct cam_periph *
+-ciss_find_periph(struct ciss_softc *sc, int bus, int target)
+-{
+-    struct cam_periph	*periph;
+-    struct cam_path	*path;
+-    int			status;
+-
+-    status = xpt_create_path(&path, NULL, cam_sim_path(sc->ciss_cam_sim[bus]),
+-			     target, 0);
+-    if (status == CAM_REQ_CMP) {
+-	periph = cam_periph_find(path, NULL);
+-	xpt_free_path(path);
+-    } else {
+-	periph = NULL;
+-    }
+-    return(periph);
+-}
+-
+-/********************************************************************************
+  * Name the device at (target)
+  *
+  * XXX is this strictly correct?
+@@ -3427,12 +3404,22 @@
+ ciss_name_device(struct ciss_softc *sc, int bus, int target)
+ {
+     struct cam_periph	*periph;
++    struct cam_path	*path;
++    int			status;
+ 
+     if (CISS_IS_PHYSICAL(bus))
+ 	return (0);
+-    if ((periph = ciss_find_periph(sc, bus, target)) != NULL) {
++
++    status = xpt_create_path(&path, NULL, cam_sim_path(sc->ciss_cam_sim[bus]),
++			     target, 0);
++
++    if (status == CAM_REQ_CMP) {
++	xpt_path_lock(path);
++	periph = cam_periph_find(path, NULL);
+ 	sprintf(sc->ciss_logical[bus][target].cl_name, "%s%d",
+ 		periph->periph_name, periph->unit_number);
++	xpt_path_unlock(path);
++	xpt_free_path(path);
+ 	return(0);
+     }
+     sc->ciss_logical[bus][target].cl_name[0] = 0;
+Index: .
+===================================================================
+--- .	(revision 264509)
++++ .	(revision 264510)
+
+Property changes on: .
+___________________________________________________________________
+Modified: svn:mergeinfo
+   Merged /head:r264354

Deleted: trunk/kfreebsd-10/debian/patches/EN-14_05.execve.patch
===================================================================
--- trunk/kfreebsd-10/debian/patches/EN-14_05.execve.patch	2014-05-20 12:14:02 UTC (rev 5474)
+++ trunk/kfreebsd-10/debian/patches/EN-14_05.execve.patch	2014-05-20 12:23:11 UTC (rev 5475)
@@ -1,68 +0,0 @@
-Description:
- Fix triple fault on execve from 64-bit thread to 32-bit process. [EN-14:05]
-Origin: vendor
-Bug-Debian: http://bugs.debian.org/748744
-Applied-Upstream: http://svnweb.freebsd.org/base?view=revision&revision=266464
-
---- kfreebsd-10-10.0.orig/sys/kern/kern_exec.c
-+++ kfreebsd-10-10.0/sys/kern/kern_exec.c
-@@ -283,6 +283,7 @@
- 	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 @@
- 		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 @@
- 			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);
- }
---- kfreebsd-10-10.0.orig/sys/vm/vm_map.c
-+++ kfreebsd-10-10.0/sys/vm/vm_map.c
-@@ -3725,6 +3725,8 @@
- 	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 @@
- 	PROC_VMSPACE_UNLOCK(p);
- 	if (p == curthread->td_proc)
- 		pmap_activate(curthread);
--	vmspace_free(oldvmspace);
-+	curthread->td_pflags |= TDP_EXECVMSPC;
- 	return (0);
- }
- 
---- kfreebsd-10-10.0.orig/sys/sys/proc.h
-+++ kfreebsd-10-10.0/sys/sys/proc.h
-@@ -424,6 +424,7 @@
- #define	TDP_RESETSPUR	0x04000000 /* Reset spurious page fault history. */
- #define	TDP_NERRNO	0x08000000 /* Last errno is already in td_errno */
- #define	TDP_UIOHELD	0x10000000 /* Current uio has pages held in td_ma */
-+#define	TDP_EXECVMSPC	0x40000000 /* Execve destroyed old vmspace */
- 
- /*
-  * Reasons that the current thread can not be run yet.

Copied: trunk/kfreebsd-10/debian/patches/EN-14_06.execve.patch (from rev 5472, trunk/kfreebsd-10/debian/patches/EN-14_05.execve.patch)
===================================================================
--- trunk/kfreebsd-10/debian/patches/EN-14_06.execve.patch	                        (rev 0)
+++ trunk/kfreebsd-10/debian/patches/EN-14_06.execve.patch	2014-05-20 12:23:11 UTC (rev 5475)
@@ -0,0 +1,68 @@
+Description:
+ Fix triple fault on execve from 64-bit thread to 32-bit process. [EN-14:06]
+Origin: vendor
+Bug-Debian: http://bugs.debian.org/748744
+Applied-Upstream: http://svnweb.freebsd.org/base?view=revision&revision=266464
+
+--- kfreebsd-10-10.0.orig/sys/kern/kern_exec.c
++++ kfreebsd-10-10.0/sys/kern/kern_exec.c
+@@ -283,6 +283,7 @@
+ 	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 @@
+ 		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 @@
+ 			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);
+ }
+--- kfreebsd-10-10.0.orig/sys/vm/vm_map.c
++++ kfreebsd-10-10.0/sys/vm/vm_map.c
+@@ -3725,6 +3725,8 @@
+ 	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 @@
+ 	PROC_VMSPACE_UNLOCK(p);
+ 	if (p == curthread->td_proc)
+ 		pmap_activate(curthread);
+-	vmspace_free(oldvmspace);
++	curthread->td_pflags |= TDP_EXECVMSPC;
+ 	return (0);
+ }
+ 
+--- kfreebsd-10-10.0.orig/sys/sys/proc.h
++++ kfreebsd-10-10.0/sys/sys/proc.h
+@@ -424,6 +424,7 @@
+ #define	TDP_RESETSPUR	0x04000000 /* Reset spurious page fault history. */
+ #define	TDP_NERRNO	0x08000000 /* Last errno is already in td_errno */
+ #define	TDP_UIOHELD	0x10000000 /* Current uio has pages held in td_ma */
++#define	TDP_EXECVMSPC	0x40000000 /* Execve destroyed old vmspace */
+ 
+ /*
+  * Reasons that the current thread can not be run yet.

Modified: trunk/kfreebsd-10/debian/patches/series
===================================================================
--- trunk/kfreebsd-10/debian/patches/series	2014-05-20 12:14:02 UTC (rev 5474)
+++ trunk/kfreebsd-10/debian/patches/series	2014-05-20 12:23:11 UTC (rev 5475)
@@ -5,7 +5,8 @@
 newcons.diff
 SA-14_05.nfsserver.patch
 SA-14_08.tcp.patch
-EN-14_05.execve.patch
+EN-14_05.ciss.patch
+EN-14_06.execve.patch
 
 # Patches that are in good shape for merging upstream
 mount_remount.diff




More information about the Glibc-bsd-commits mailing list