+ uml-fix-exitcall-ordering-bug.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     uml: fix exitcall ordering bug

has been added to the -mm tree.  Its filename is

     uml-fix-exitcall-ordering-bug.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: uml: fix exitcall ordering bug
From: Jeff Dike <jdike@xxxxxxxxxxx>

This fixes an exitcall ordering bug - calls to ignore_sigio_fd can come from
exitcalls that come after the sigio thread has been killed.  This would cause
shutdown to hang or crash.

Fixed by having ignore_sigio_fd check that the thread is present before trying
to communicate with it.

Signed-off-by: Jeff Dike <jdike@xxxxxxxxxxx>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@xxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 arch/um/os-Linux/sigio.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletion(-)

diff -puN arch/um/os-Linux/sigio.c~uml-fix-exitcall-ordering-bug arch/um/os-Linux/sigio.c
--- a/arch/um/os-Linux/sigio.c~uml-fix-exitcall-ordering-bug
+++ a/arch/um/os-Linux/sigio.c
@@ -191,6 +191,13 @@ int ignore_sigio_fd(int fd)
 	struct pollfd *p;
 	int err = 0, i, n = 0;
 
+	/* This is called from exitcalls elsewhere in UML - if
+	 * sigio_cleanup has already run, then update_thread will hang
+	 * or fail because the thread is no longer running.
+	 */
+	if(write_sigio_pid == -1)
+		return -EIO;
+
 	sigio_lock();
 	for(i = 0; i < current_poll.used; i++){
 		if(current_poll.poll[i].fd == fd) break;
@@ -215,7 +222,7 @@ int ignore_sigio_fd(int fd)
 	update_thread();
  out:
 	sigio_unlock();
-	return(err);
+	return err;
 }
 
 static struct pollfd *setup_initial_poll(int fd)
_

Patches currently in -mm which might be from jdike@xxxxxxxxxxx are

uml-clean-up-address-space-limits-code.patch
uml-timer-initialization-cleanup.patch
uml-remove-some-useless-exports.patch
uml-fix-static-binary-segfault.patch
uml-remove-useless-declaration.patch
uml-signal-initialization-cleanup.patch
uml-timer-handler-tidying.patch
uml-ifdef-a-mode-specific-function.patch
uml-mark-forward_interrupts-as-being-mode-specific.patch
uml-remove-spinlock-wrapper-functions.patch
uml-remove-os_isatty.patch
uml-fix-exitcall-ordering-bug.patch
uml-make-some-symbols-static.patch
uml-remove-syscall-debugging.patch
uml-move-_kernc-files.patch
uml-formatting-fixes.patch
uml-add-some-eintr-protection.patch
uml-remove-unused-variable.patch
uml-make-mconsole-version-requests-happen-in-a-process.patch
uml-remove-pte_mkexec.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux