android_kernel_samsung_msm8976/fs/fscache
Eric Biggers 03a573da47 FS-Cache: fix dereference of NULL user_key_payload
commit d124b2c53c7bee6569d2a2d0b18b4a1afde00134 upstream.

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: 4fbf4291aa ("FS-Cache: Allow the current state of all objects to be dumped")
Reviewed-by: James Morris <james.l.morris@oracle.com>
Cc: <stable@vger.kernel.org>    [v2.6.32+]
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
2019-07-27 21:44:20 +02:00
..
cache.c FS-Cache: Limit the number of I/O error reports for a cache 2012-12-20 22:10:44 +00:00
cookie.c hlist: drop the node parameter from iterators 2013-02-27 19:10:24 -08:00
fsdef.c
histogram.c
internal.h FS-Cache: Clear remaining page count on retrieval cancellation 2012-12-20 22:35:15 +00:00
Kconfig
main.c
Makefile
netfs.c FS-Cache: Increase reference of parent after registering, netfs success 2016-02-19 14:22:41 -08:00
object-list.c FS-Cache: fix dereference of NULL user_key_payload 2019-07-27 21:44:20 +02:00
object.c FS-Cache: Add transition to handle invalidate immediately after lookup 2012-12-20 22:19:22 +00:00
operation.c FS-Cache: Clear remaining page count on retrieval cancellation 2012-12-20 22:35:15 +00:00
page.c FS-Cache: Clear remaining page count on retrieval cancellation 2012-12-20 22:35:15 +00:00
proc.c
stats.c fs/fscache/stats.c: fix memory leak 2013-04-29 15:54:27 -07:00