[676] in Athena Bugs

home help back first fref pref prev next nref lref last post

RT 6.0C kernel: copyin doesn't like zero-lengths

daemon@ATHENA.MIT.EDU (John T Kohl)
Mon Aug 29 11:25:39 1988

Date: Mon, 29 Aug 88 11:25:06 EDT
From: John T Kohl <jtkohl@ATHENA.MIT.EDU>
To: bugs@ATHENA.MIT.EDU
The kernel copyin() routine sys/ca/vmaccess.c doesn't work properly when
asked to copy a zero length.

Inspection reveals that it dies in isitok() in sys/ca/vm_machdep.c,
which computes that the end address is less than the start address.

This is probably valid.  I suggest that copyin(), if handed a zero
length, ignore the entire copy process and return zero.
(Alternatively, it can ignore the isitok() check, or isitok() could be
modified to trap zero lengths and say "ok".  bcopy(), found in
libc/ca/gen/blt.s, does nothing when passed a zero length.)

We should probably send this bug back to IBM people.  The VAX has no
problem when using copyin() on a zero length.

John

home help back first fref pref prev next nref lref last post