From: James Morris Date: Tue, 03 Oct 2017 10:51:35 +0000 Subject: Re: [PATCH 2/7] FS-Cache: fix dereference of NULL user_key_payload Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit List-Id: References: <20170928212602.41744-1-ebiggers3@gmail.com> <20170928212602.41744-3-ebiggers3@gmail.com> In-Reply-To: <20170928212602.41744-3-ebiggers3@gmail.com> To: Eric Biggers Cc: keyrings@vger.kernel.org, David Howells , Michael Halcrow , linux-cachefs@redhat.com, ecryptfs@vger.kernel.org, linux-fscrypt@vger.kernel.org, linux-security-module@vger.kernel.org, Eric Biggers , stable@vger.kernel.org On Thu, 28 Sep 2017, Eric Biggers wrote: > From: Eric Biggers > > When the file /proc/fs/fscache/objects (available with > CONFIG_FSCACHE_OBJECT_LIST=y) is opened, we request a user key with > description "fscache:objlist", then access its payload. However, a > revoked key has a NULL payload, and we failed to check for this. > request_key() *does* skip revoked keys, but there is still a window > where the key can be revoked before we access its payload. > > Fix it by checking for a NULL payload, treating it like a key which was > already revoked at the time it was requested. > > Fixes: 4fbf4291aa15 ("FS-Cache: Allow the current state of all objects to be dumped") > Cc: [v2.6.32+] > Signed-off-by: Eric Biggers Reviewed-by: James Morris -- James Morris