Subject: Re: copyin/copyout argument checking
To: Mark Brinicombe <mark@causality.com>
From: Robert Elz <kre@munnari.OZ.AU>
List: tech-kern
Date: 07/29/1998 18:06:50
Date: Wed, 29 Jul 1998 01:45:02 +0100 (BST)
From: Mark Brinicombe <mark@causality.com>
Message-ID: <Pine.NEB.3.96.980729013411.1567A-100000@loneshark.causality.com>
| Is the description in the manual page just lacking and this is the
| defiend behaviour or should the kernel not rely on this behaviour ?
Traditionally (like from ancient n'th edition unixes), copyin/out would
return error if the user processes accessing the addresses listed would
have generated an SIGBUS or SIGSEGV.
So, yes, certainly, an attempt to reference kernel memory (in the user
space address range) is an error.
However, a length of 0 means no addresses will be dereferenced, and so no
error should be generated (copyin/out with a length of 0 are not intended
to be user space address validation functions).
kre