Jamie Lokier replied:
> - If you block the user process, then you can access the user-space data
> safely. Most drivers do this one way or another.
Note that it is *not* safe to assume that if you read user-space data
twice, it will be the same! If you need a data structure to be
consistent for security, copy it to kernel space. There are just too
many ways to update user memory while a thread is running in the kernel.
Most of them involve another process or thread either sharing the memory
or using ptrace() to change it. It might seem safe to assume that
this will only happen if the kernel side blocks and lets a user process
run, but then you'll hit an SMP system.
It *is* reaosnable to say that "if you modify this buffer while the
system call is in progress, you'll get bizarre results", but those
bizarre results better not include crashing the system.
-- -Colin- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/