KEYS: fix in-kernel documentation for keyctl_read()
When keyctl_read() is passed a buffer that is too small, the behavior is inconsistent. Some key types will fill as much of the buffer as possible, while others won't copy anything. Moreover, the in-kernel documentation contradicted the man page on this point. Update the in-kernel documentation to say that this point is unspecified. Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: David Howells <dhowells@redhat.com>
This commit is contained in:
parent
37cb8e1f8e
commit
be543dd626
|
@ -628,12 +628,12 @@ The keyctl syscall functions are:
|
||||||
defined key type will return its data as is. If a key type does not
|
defined key type will return its data as is. If a key type does not
|
||||||
implement this function, error EOPNOTSUPP will result.
|
implement this function, error EOPNOTSUPP will result.
|
||||||
|
|
||||||
As much of the data as can be fitted into the buffer will be copied to
|
If the specified buffer is too small, then the size of the buffer required
|
||||||
userspace if the buffer pointer is not NULL.
|
will be returned. Note that in this case, the contents of the buffer may
|
||||||
|
have been overwritten in some undefined way.
|
||||||
On a successful return, the function will always return the amount of data
|
|
||||||
available rather than the amount copied.
|
|
||||||
|
|
||||||
|
Otherwise, on success, the function will return the amount of data copied
|
||||||
|
into the buffer.
|
||||||
|
|
||||||
* Instantiate a partially constructed key::
|
* Instantiate a partially constructed key::
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue