OSDN Git Service

[PATCH] loop.c: kernel_thread() retval check
authorSolar Designer <solar@openwall.com>
Sat, 19 Aug 2006 23:46:29 +0000 (03:46 +0400)
committerWilly Tarreau <w@1wt.eu>
Mon, 28 Aug 2006 04:29:47 +0000 (06:29 +0200)
commit859abf20cf365e97360f8dae1d4b5c75947a41bf
tree0affd9e6e6ae11d4573b6902d91e2169ac49fa0b
parentcdcc944c2cc851397ca6a01f5312d717f832d373
[PATCH] loop.c: kernel_thread() retval check

Patch extracted from 2.4.33-ow1. It has also been ported to 2.6 by
Julio Auto.

Basically, the code in drivers/block/loop.c did not check the return
value from kernel_thread().  If kernel_thread() would fail, the code
would misbehave (IIRC, the invoking process would become unkillable).

An easy way to trigger the bug was to run losetup under strace (as
root), and this is also how I tested the error path added with this
patch.

This change has been a part of publicly released -ow patches for 8+
months.

There are more instances of kernel_thread() calls that do not check the
return value; some of the remaining ones might need to be fixed, too.

Acked-by: Alan Cox <alan@redhat.com>
drivers/block/loop.c