]> git.karo-electronics.de Git - karo-tx-linux.git/commit
dm io: make sync_io uninterruptible
authorMikulas Patocka <mpatocka@redhat.com>
Fri, 3 Apr 2009 17:45:21 +0000 (17:45 +0000)
committerChris Wright <chrisw@sous-sol.org>
Mon, 27 Apr 2009 17:36:56 +0000 (10:36 -0700)
commit07280df84ae0357594f65e8e56042822c9697fbd
tree7e76c5467ed3dfdf4bef30768b877b4662f19aab
parent6858778b9cf9436f667a101ffc62c20f889ea294
dm io: make sync_io uninterruptible

upstream commit: b64b6bf4fd8b678a9f8477c11773c38a0a246a6d

If someone sends signal to a process performing synchronous dm-io call,
the kernel may crash.

The function sync_io attempts to exit with -EINTR if it has pending signal,
however the structure "io" is allocated on stack, so already submitted io
requests end up touching unallocated stack space and corrupting kernel memory.

sync_io sets its state to TASK_UNINTERRUPTIBLE, so the signal can't break out
of io_schedule() --- however, if the signal was pending before sync_io entered
while (1) loop, the corruption of kernel memory will happen.

There is no way to cancel in-progress IOs, so the best solution is to ignore
signals at this point.

Cc: stable@kernel.org
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
drivers/md/dm-io.c