All of lore.kernel.org
 help / color / mirror / Atom feed
* [keyutils PATCH v2] man: keyctl_read(3): fix documentation for short buffer case
@ 2017-11-02 18:06 Eric Biggers
  2018-02-20 19:42 ` Eric Biggers
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Biggers @ 2017-11-02 18:06 UTC (permalink / raw)
  To: keyrings

From: Eric Biggers <ebiggers@google.com>

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 man page to say that this point is unspecified.

Signed-off-by: Eric Biggers <ebiggers@google.com>
---
 man/keyctl_read.3 | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/man/keyctl_read.3 b/man/keyctl_read.3
index 25821ad..852bc05 100644
--- a/man/keyctl_read.3
+++ b/man/keyctl_read.3
@@ -33,8 +33,8 @@ permission on a key to be able to read it.
 and
 .I buflen
 specify the buffer into which the payload data will be placed.  If the buffer
-is too small, the full size of the payload will be returned and no copy will
-take place.
+is too small, then the full size of the payload will be returned, and the
+contents of the buffer may be overwritten in some undefined way.
 .P
 .BR keyctl_read_alloc ()
 is similar to
@@ -62,8 +62,8 @@ though the byte-ordering is as appropriate for the kernel.
 On success
 .BR keyctl_read ()
 returns the amount of data placed into the buffer.  If the buffer was too
-small, then the size of buffer required will be returned, but no data will be
-transferred.
+small, then the size of buffer required will be returned, and the contents of
+the buffer may have been overwritten in some undefined way.
 .P
 On success
 .BR keyctl_read_alloc ()
-- 
2.15.0.403.gc27cc4dac6-goog


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [keyutils PATCH v2] man: keyctl_read(3): fix documentation for short buffer case
@ 2018-02-20 19:42 ` Eric Biggers
  2018-05-08 18:07     ` Eric Biggers
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Biggers @ 2018-02-20 19:42 UTC (permalink / raw)
  To: keyrings

On Thu, Nov 02, 2017 at 11:06:05AM -0700, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@google.com>
> 
> 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 man page to say that this point is unspecified.
> 
> Signed-off-by: Eric Biggers <ebiggers@google.com>
> ---
>  man/keyctl_read.3 | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/man/keyctl_read.3 b/man/keyctl_read.3
> index 25821ad..852bc05 100644
> --- a/man/keyctl_read.3
> +++ b/man/keyctl_read.3
> @@ -33,8 +33,8 @@ permission on a key to be able to read it.
>  and
>  .I buflen
>  specify the buffer into which the payload data will be placed.  If the buffer
> -is too small, the full size of the payload will be returned and no copy will
> -take place.
> +is too small, then the full size of the payload will be returned, and the
> +contents of the buffer may be overwritten in some undefined way.
>  .P
>  .BR keyctl_read_alloc ()
>  is similar to
> @@ -62,8 +62,8 @@ though the byte-ordering is as appropriate for the kernel.
>  On success
>  .BR keyctl_read ()
>  returns the amount of data placed into the buffer.  If the buffer was too
> -small, then the size of buffer required will be returned, but no data will be
> -transferred.
> +small, then the size of buffer required will be returned, and the contents of
> +the buffer may have been overwritten in some undefined way.
>  .P
>  On success
>  .BR keyctl_read_alloc ()
> -- 
> 2.15.0.403.gc27cc4dac6-goog
> 

Ping.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [keyutils PATCH v2] man: keyctl_read(3): fix documentation for short buffer case
  2018-02-20 19:42 ` Eric Biggers
@ 2018-05-08 18:07     ` Eric Biggers
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Biggers @ 2018-05-08 18:07 UTC (permalink / raw)
  To: keyrings, David Howells; +Cc: Ben Hutchings, linux-doc, Eric Biggers

On Tue, Feb 20, 2018 at 11:42:34AM -0800, Eric Biggers wrote:
> On Thu, Nov 02, 2017 at 11:06:05AM -0700, Eric Biggers wrote:
> > From: Eric Biggers <ebiggers@google.com>
> > 
> > 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 man page to say that this point is unspecified.
> > 
> > Signed-off-by: Eric Biggers <ebiggers@google.com>
> > ---
> >  man/keyctl_read.3 | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/man/keyctl_read.3 b/man/keyctl_read.3
> > index 25821ad..852bc05 100644
> > --- a/man/keyctl_read.3
> > +++ b/man/keyctl_read.3
> > @@ -33,8 +33,8 @@ permission on a key to be able to read it.
> >  and
> >  .I buflen
> >  specify the buffer into which the payload data will be placed.  If the buffer
> > -is too small, the full size of the payload will be returned and no copy will
> > -take place.
> > +is too small, then the full size of the payload will be returned, and the
> > +contents of the buffer may be overwritten in some undefined way.
> >  .P
> >  .BR keyctl_read_alloc ()
> >  is similar to
> > @@ -62,8 +62,8 @@ though the byte-ordering is as appropriate for the kernel.
> >  On success
> >  .BR keyctl_read ()
> >  returns the amount of data placed into the buffer.  If the buffer was too
> > -small, then the size of buffer required will be returned, but no data will be
> > -transferred.
> > +small, then the size of buffer required will be returned, and the contents of
> > +the buffer may have been overwritten in some undefined way.
> >  .P
> >  On success
> >  .BR keyctl_read_alloc ()
> > -- 
> > 2.15.0.403.gc27cc4dac6-goog
> > 
> 
> Ping.

Ping.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [keyutils PATCH v2] man: keyctl_read(3): fix documentation for short buffer case
@ 2018-05-08 18:07     ` Eric Biggers
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Biggers @ 2018-05-08 18:07 UTC (permalink / raw)
  To: keyrings, David Howells; +Cc: Ben Hutchings, linux-doc, Eric Biggers

On Tue, Feb 20, 2018 at 11:42:34AM -0800, Eric Biggers wrote:
> On Thu, Nov 02, 2017 at 11:06:05AM -0700, Eric Biggers wrote:
> > From: Eric Biggers <ebiggers@google.com>
> > 
> > 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 man page to say that this point is unspecified.
> > 
> > Signed-off-by: Eric Biggers <ebiggers@google.com>
> > ---
> >  man/keyctl_read.3 | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/man/keyctl_read.3 b/man/keyctl_read.3
> > index 25821ad..852bc05 100644
> > --- a/man/keyctl_read.3
> > +++ b/man/keyctl_read.3
> > @@ -33,8 +33,8 @@ permission on a key to be able to read it.
> >  and
> >  .I buflen
> >  specify the buffer into which the payload data will be placed.  If the buffer
> > -is too small, the full size of the payload will be returned and no copy will
> > -take place.
> > +is too small, then the full size of the payload will be returned, and the
> > +contents of the buffer may be overwritten in some undefined way.
> >  .P
> >  .BR keyctl_read_alloc ()
> >  is similar to
> > @@ -62,8 +62,8 @@ though the byte-ordering is as appropriate for the kernel.
> >  On success
> >  .BR keyctl_read ()
> >  returns the amount of data placed into the buffer.  If the buffer was too
> > -small, then the size of buffer required will be returned, but no data will be
> > -transferred.
> > +small, then the size of buffer required will be returned, and the contents of
> > +the buffer may have been overwritten in some undefined way.
> >  .P
> >  On success
> >  .BR keyctl_read_alloc ()
> > -- 
> > 2.15.0.403.gc27cc4dac6-goog
> > 
> 
> Ping.

Ping.
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-05-08 18:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-02 18:06 [keyutils PATCH v2] man: keyctl_read(3): fix documentation for short buffer case Eric Biggers
2018-02-20 19:42 ` Eric Biggers
2018-05-08 18:07   ` Eric Biggers
2018-05-08 18:07     ` Eric Biggers

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.