[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <10708.1508426843@warthog.procyon.org.uk>
Date: Thu, 19 Oct 2017 16:27:23 +0100
From: David Howells <dhowells@...hat.com>
To: Eric Biggers <ebiggers@...gle.com>
Cc: dhowells@...hat.com, Ben Hutchings <ben.hutchings@...ethink.co.uk>,
stable@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4.4 11/41] KEYS: fix writing past end of user-supplied buffer in keyring_read()
Eric Biggers <ebiggers@...gle.com> wrote:
> Hi Ben, thanks for pointing this out. I had assumed the "obvious" semantics,
> but it turns out that's not what's documented.
The manpage is correct. keyctl_read_alloc() in libkeyutils relies on the
behaviour documented there with respect to the full size of the data always
being returned, even if the buffer was too small.
The keyring cannot be modified whilst it is being read, so that's not a
concern.
keyctl_read_alloc() doesn't care if the buffer actually gets written to or
not, but it's best to honour the manpage.
David
Powered by blists - more mailing lists