Your patch looks fine but you realize, of course, that both your vwrite()
and the old vread() walk through vmlist without any locking so results can
be not only incosistent but disastrous (on SMP if list is modified at teh
same time).
A long time ago I made a patch that protects vmlist with rw spinlock:
http://www.ocston.org/~tigran/patches/vmalloc-only-2.3.35-p1.patch
at that time it was not considered critical so it was not accepted.
Perhaps now that there seem to be more users of vmlist (other than
"normal" ones) it makes sense to reconsider.
I post to the list and not to Linus because I need your guys' opinions
before I decide whether to resend it to Linus or not.
Also, one correction to your patch - when accessing userspace you should
really check the return code and return -EFAULT if not 0. I know that
read_kmem() doesn't do that but that is a bug (which while you are there,
you should fix as well).
Regards,
------
Tigran A. Aivazian | http://www.sco.com
Escalations Research Group | tel: +44-(0)1923-813796
Santa Cruz Operation Ltd | http://www.ocston.org/~tigran
-
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/