Re: [Patch]: write_kmem above high_memory

Manfred Spraul (manfreds@colorfullife.com)
Tue, 04 Jan 2000 13:36:50 +0100


Andi Kleen wrote:
>
> tigran@sco.COM (Tigran Aivazian) writes:
>
> > Hi,
> >
> > 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).
>
> The more elegant way would be probably to remove all checks in these
> functions, and instead protect the read/writes with a exception table
> entry similar to copy_from/to_user. Only drawback is that it needs
> per architecture support.
>

set_fs(KERNEL_DS) + get_user()/__get_user()?

BUT: that's dangerous, because we might read from the mmap'ed io space
of a hardware device.

The current show_registers() [arch/i386/kernel/traps.c] code has the
same problem: on SMP, it causes a hard lock-up if the EIP value got
corrupted.
Linus rejected my first patch [walks the page tables], and I'm waiting
for an answer on my new patch [__get_user()].

--
	Manfred

- 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/