Re: [BUG?] x86_64 : Can not read /dev/kmem ?

Andi Kleen
2005-03-21T19:37:10Z

Sorry for the late answer.

On Mon, Mar 14, 2005 at 11:37:19AM +0100, Eric Dumazet wrote:
>
> Hi Andi
>
> I tried to read /dev/kmem on x86_64 (linux-2.6.11) and got no success.
>
> read() or pread() returns EINVAL

Yes. I fixed this once for 2.4, but somehow the changes never made
it into 2.6. The VFS code doesn't like negative offsets, and the kernel
addresses are negative.

>
> I tried mmap() too : mmap() calls succeed, but as soon the user process
> dereference memory, we get :

Hmm, looks like a bug yes. I can reproduce it. Thanks for the report.
Will investigate later.

-Andi