Re: [PATCH -rt] race condition in fs/compat.c with compat_sys_ioctl

From: Ingo Molnar
Date: Wed Nov 16 2005 - 05:04:48 EST



* Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> It's still there in 2.6.15-rc1-git3 (the sem is the down_read of
> ioctl32_sem in fs/compat.c).
>
> No, the problem was unique to the rt patch. In -rt the default
> down_read is just like a down (since it is very hard to do PI on
> readers and writer locks). So the solution in -rt was to convert this
> back to a normal RW sem.

to be precise: rwsems in PREEMPT_RT are "only one reader, but reader
might self-recurse". I.e. the sequence of:

down_read();
...
down_read();
...
up_read();
...
up_read();

is still supported.

this very simple rw-semaphore type covers the overwhelming majority of
uses: out of hundreds of rwsems in the kernel, ioctl32_sem is the first
one that had to be converted to a 'compat' rwsem.

Ingo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/