summarylogtreecommitdiffstats
path: root/0001-Linux-4.4-key_payload-has-no-member-value.patch
diff options
context:
space:
mode:
Diffstat (limited to '0001-Linux-4.4-key_payload-has-no-member-value.patch')
-rw-r--r--0001-Linux-4.4-key_payload-has-no-member-value.patch84
1 files changed, 84 insertions, 0 deletions
diff --git a/0001-Linux-4.4-key_payload-has-no-member-value.patch b/0001-Linux-4.4-key_payload-has-no-member-value.patch
new file mode 100644
index 00000000000..68f429af739
--- /dev/null
+++ b/0001-Linux-4.4-key_payload-has-no-member-value.patch
@@ -0,0 +1,84 @@
+From 2d524981c32ac8f502fa344aac1a4952c64078f1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Michael=20La=C3=9F?= <lass@mail.uni-paderborn.de>
+Date: Mon, 18 Jan 2016 18:29:00 +0100
+Subject: [PATCH 1/3] Linux 4.4: key_payload has no member 'value'
+
+In Linux 4.4 (146aa8b1453bd8f1ff2304ffb71b4ee0eb9acdcc) type-specific and
+payload data have been merged. The payload is now accessed directly and has
+no 'value' member anymore.
+
+FIXES 132677
+
+Reviewed-on: https://gerrit.openafs.org/12169
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
+Tested-by: Mark Vitale <mvitale@sinenomine.net>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit 5067ee3ae11932a3f1c972c8f88b20afbd9e1d88)
+
+Change-Id: I5a3e89b2676b463935e9a77042cbcd8ab812dc68
+---
+ acinclude.m4 | 1 +
+ src/afs/LINUX/osi_groups.c | 16 +++++++++++++++-
+ 2 files changed, 16 insertions(+), 1 deletion(-)
+
+diff --git a/acinclude.m4 b/acinclude.m4
+index b1444a1..a7a7cb6 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -882,6 +882,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
+ AC_CHECK_LINUX_STRUCT([file_operations], [sendfile], [fs.h])
+ AC_CHECK_LINUX_STRUCT([file_system_type], [mount], [fs.h])
+ AC_CHECK_LINUX_STRUCT([inode_operations], [truncate], [fs.h])
++ AC_CHECK_LINUX_STRUCT([key], [payload.value], [key.h])
+ AC_CHECK_LINUX_STRUCT([key_type], [instantiate_prep], [key-type.h])
+ AC_CHECK_LINUX_STRUCT([key_type], [match_preparse], [key-type.h])
+ AC_CHECK_LINUX_STRUCT([key_type], [preparse], [key-type.h])
+diff --git a/src/afs/LINUX/osi_groups.c b/src/afs/LINUX/osi_groups.c
+index 3b068e5..a83bcb9 100644
+--- a/src/afs/LINUX/osi_groups.c
++++ b/src/afs/LINUX/osi_groups.c
+@@ -489,7 +489,11 @@ static int afs_pag_instantiate(struct key *key, const void *data, size_t datalen
+ if (*userpag != pag)
+ goto error;
+
++#if defined(STRUCT_KEY_HAS_PAYLOAD_VALUE)
+ key->payload.value = (unsigned long) *userpag;
++#else
++ memcpy(&key->payload, userpag, sizeof(afs_uint32));
++#endif
+ key->datalen = sizeof(afs_uint32);
+ code = 0;
+
+@@ -513,9 +517,15 @@ static int afs_pag_match(const struct key *key, const void *description)
+
+ static void afs_pag_destroy(struct key *key)
+ {
+- afs_uint32 pag = key->payload.value;
++ afs_uint32 pag;
+ int locked = ISAFS_GLOCK();
+
++#if defined(STRUCT_KEY_HAS_PAYLOAD_VALUE)
++ pag = key->payload.value;
++#else
++ memcpy(&pag, &key->payload, sizeof(afs_uint32));
++#endif
++
+ if (!locked)
+ AFS_GLOCK();
+
+@@ -609,7 +619,11 @@ osi_get_keyring_pag(afs_ucred_t *cred)
+
+ if (!IS_ERR(key)) {
+ if (key_validate(key) == 0 && uid_eq(key->uid, GLOBAL_ROOT_UID)) { /* also verify in the session keyring? */
++#if defined(STRUCT_KEY_HAS_PAYLOAD_VALUE)
+ keyring_pag = key->payload.value;
++#else
++ memcpy(&keyring_pag, &key->payload, sizeof(afs_int32));
++#endif
+ /* Only set PAG in groups if needed,
+ * and the creds are from the current process */
+ if (afs_linux_cred_is_current(cred) &&
+--
+2.7.4
+