]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Jan 2022 14:58:12 +0000 (15:58 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Jan 2022 14:58:12 +0000 (15:58 +0100)
added patches:
fscache_cookie_enabled-check-cookie-is-valid-before-accessing-it.patch

queue-5.15/fscache_cookie_enabled-check-cookie-is-valid-before-accessing-it.patch [new file with mode: 0644]
queue-5.15/series [new file with mode: 0644]

diff --git a/queue-5.15/fscache_cookie_enabled-check-cookie-is-valid-before-accessing-it.patch b/queue-5.15/fscache_cookie_enabled-check-cookie-is-valid-before-accessing-it.patch
new file mode 100644 (file)
index 0000000..8d7bee8
--- /dev/null
@@ -0,0 +1,33 @@
+From 0dc54bd4d6e03be1f0b678c4297170b79f1a44ab Mon Sep 17 00:00:00 2001
+From: Dominique Martinet <asmadeus@codewreck.org>
+Date: Wed, 3 Nov 2021 17:34:05 +0900
+Subject: fscache_cookie_enabled: check cookie is valid before accessing it
+
+From: Dominique Martinet <asmadeus@codewreck.org>
+
+commit 0dc54bd4d6e03be1f0b678c4297170b79f1a44ab upstream.
+
+fscache_cookie_enabled() could be called on NULL cookies and cause a
+null pointer dereference when accessing cookie flags: just make sure
+the cookie is valid first
+
+Suggested-by: David Howells <dhowells@redhat.com>
+Acked-by: David Howells <dhowells@redhat.com>
+Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
+Cc: Jeffrey E Altman <jaltman@auristor.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ include/linux/fscache.h |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/include/linux/fscache.h
++++ b/include/linux/fscache.h
+@@ -167,7 +167,7 @@ struct fscache_cookie {
+ static inline bool fscache_cookie_enabled(struct fscache_cookie *cookie)
+ {
+-      return test_bit(FSCACHE_COOKIE_ENABLED, &cookie->flags);
++      return fscache_cookie_valid(cookie) && test_bit(FSCACHE_COOKIE_ENABLED, &cookie->flags);
+ }
+ /*
diff --git a/queue-5.15/series b/queue-5.15/series
new file mode 100644 (file)
index 0000000..7fc268c
--- /dev/null
@@ -0,0 +1 @@
+fscache_cookie_enabled-check-cookie-is-valid-before-accessing-it.patch