/dev/kmem read return value is double requested value

Alan Robinson alan.robinson at fujitsu-siemens.com
Fri May 30 04:24:14 PDT 2003


Hi Folks,

I was playing with a user-land program that read some data out
of the kernel memory and noticed that the read() return value was
twice what I was expecting. I think the error is in the mmrw() function
in file sys/ia64/ia64/mem.c, removing the following lines seems to 
fix the problem.

                iov->iov_base = (char *)iov->iov_base + c;
                iov->iov_len -= c;
                uio->uio_offset += c;
                uio->uio_resid -= c;

I had a little look at some of the other sys/ARCH/ARCH/mem.c and some others
seem to contain the same code so I might be wrong, then again so might the
ARCHs.

Note that the actual data transfered is OK, just the read() return value
and the /dev/kmem file offset are wrong after returning from the read().


Alan
PS is this the reason there is no gdb ?


More information about the freebsd-ia64 mailing list