]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.1-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 May 2026 08:10:23 +0000 (10:10 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 May 2026 08:10:23 +0000 (10:10 +0200)
added patches:
smb-client-reject-userspace-cifs.spnego-descriptions.patch

queue-6.1/series
queue-6.1/smb-client-reject-userspace-cifs.spnego-descriptions.patch [new file with mode: 0644]

index f64db0c71d1054163f79771a8e155b1d3981f9a6..2c7bbfb56a7a94658c3aedfceeec2ae4644f719e 100644 (file)
@@ -835,3 +835,4 @@ s390-debug-reject-zero-length-input-before-trimming-.patch
 wifi-mac80211-check-tdls-flag-in-ieee80211_tdls_oper.patch
 revert-x86-vdso-fix-output-operand-size-of-rdpid.patch
 revert-s390-cio-fix-device-lifecycle-handling-in-css.patch
+smb-client-reject-userspace-cifs.spnego-descriptions.patch
diff --git a/queue-6.1/smb-client-reject-userspace-cifs.spnego-descriptions.patch b/queue-6.1/smb-client-reject-userspace-cifs.spnego-descriptions.patch
new file mode 100644 (file)
index 0000000..f9a7bd4
--- /dev/null
@@ -0,0 +1,66 @@
+From 3da1fdf4efbc490041eb4f836bf596201203f8f2 Mon Sep 17 00:00:00 2001
+From: Asim Viladi Oglu Manizada <manizada@pm.me>
+Date: Sat, 16 May 2026 21:15:39 +0000
+Subject: smb: client: reject userspace cifs.spnego descriptions
+
+From: Asim Viladi Oglu Manizada <manizada@pm.me>
+
+commit 3da1fdf4efbc490041eb4f836bf596201203f8f2 upstream.
+
+cifs.spnego key descriptions contain authority-bearing fields such as
+pid, uid, creduid, and upcall_target that cifs.upcall treats as
+kernel-originating inputs. However, userspace can also create keys of
+this type through request_key(2) or add_key(2), allowing those fields to
+be supplied without CIFS origin.
+
+Only accept cifs.spnego descriptions while CIFS is using its private
+spnego_cred to request the key.
+
+Fixes: f1d662a7d5e5 ("[CIFS] Add upcall files for cifs to use spnego/kerberos")
+Assisted-by: avom-custom-harness:gpt-5.5-qwen3.6-mod-mix
+Reviewed-by: David Howells <dhowells@redhat.com>
+Signed-off-by: Asim Viladi Oglu Manizada <manizada@pm.me>
+Signed-off-by: Steve French <stfrench@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/smb/client/cifs_spnego.c |   16 ++++++++++++++++
+ 1 file changed, 16 insertions(+)
+
+--- a/fs/smb/client/cifs_spnego.c
++++ b/fs/smb/client/cifs_spnego.c
+@@ -8,6 +8,7 @@
+  */
+ #include <linux/list.h>
++#include <linux/cred.h>
+ #include <linux/slab.h>
+ #include <linux/string.h>
+ #include <keys/user-type.h>
+@@ -46,12 +47,27 @@ cifs_spnego_key_destroy(struct key *key)
+       kfree(key->payload.data[0]);
+ }
++static int
++cifs_spnego_key_vet_description(const char *description)
++{
++      /*
++       * cifs.spnego descriptions are authority-bearing inputs to cifs.upcall.
++       * They are only valid when produced by CIFS while using the private
++       * spnego_cred installed below.  Do not let userspace create this type
++       * of key through request_key(2)/add_key(2), since the helper treats
++       * pid/uid/creduid/upcall_target as kernel-originating fields.
++       */
++      if (current_cred() != spnego_cred)
++              return -EPERM;
++      return 0;
++}
+ /*
+  * keytype for CIFS spnego keys
+  */
+ struct key_type cifs_spnego_key_type = {
+       .name           = "cifs.spnego",
++      .vet_description = cifs_spnego_key_vet_description,
+       .instantiate    = cifs_spnego_key_instantiate,
+       .destroy        = cifs_spnego_key_destroy,
+       .describe       = user_describe,