summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Lass2021-01-14 16:42:00 +0100
committerMichael Lass2021-01-14 16:42:00 +0100
commit87324038e50498205be512e940f29664a208d189 (patch)
treefa0cd995d943fbf5c636d2b158c33636fa86580f
parent30a458a91068cb47f176c44aa09fb7d90d1aa6a9 (diff)
downloadaur-87324038e50498205be512e940f29664a208d189.tar.gz
Fix RX bug triggered after 14.01.2021 08:25:36 UTC
These are early stage patches. However, unpatched OpenAFS is unusable right now. See: https://gerrit.openafs.org/#/c/14491/ https://gerrit.openafs.org/#/c/14492/
-rw-r--r--.SRCINFO16
-rw-r--r--0001-Temporary-fix-for-compilation-with-GCC-10.patch4
-rw-r--r--0002-LINUX-5.8-Replace-kernel_setsockopt-with-new-funcs.patch4
-rw-r--r--0003-LINUX-5.8-do-not-set-name-field-in-backing_dev_info.patch4
-rw-r--r--0004-LINUX-5.8-use-lru_cache_add.patch4
-rw-r--r--0005-LINUX-5.9-Remove-HAVE_UNLOCKED_IOCTL-COMPAT_IOCTL.patch4
-rw-r--r--0006-rx-rx_InitHost-do-not-overwrite-RAND_bytes-rx_nextCi.patch39
-rw-r--r--0007-rx-update_nextCid-overflow-handling-is-broken.patch52
-rw-r--r--PKGBUILD24
9 files changed, 128 insertions, 23 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 3cee51e6dd86..f0e9558be8e2 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = openafs-modules-dkms
pkgdesc = Kernel module for OpenAFS (dkms)
pkgver = 1.8.6
- pkgrel = 3
+ pkgrel = 4
url = http://www.openafs.org
arch = i686
arch = x86_64
@@ -22,13 +22,17 @@ pkgbase = openafs-modules-dkms
source = 0003-LINUX-5.8-do-not-set-name-field-in-backing_dev_info.patch
source = 0004-LINUX-5.8-use-lru_cache_add.patch
source = 0005-LINUX-5.9-Remove-HAVE_UNLOCKED_IOCTL-COMPAT_IOCTL.patch
+ source = 0006-rx-rx_InitHost-do-not-overwrite-RAND_bytes-rx_nextCi.patch
+ source = 0007-rx-update_nextCid-overflow-handling-is-broken.patch
sha256sums = 8b4e9d3180f1ecd752753da17ac630df04eb7007c90a921a5f6403c0339d2945
sha256sums = 5ea5e184f9b44f5ed45817d2b5a10149d15c8c54f49e0b5b4b773652673cb9b0
- sha256sums = 604fc461acf66dc833baa434023320ab656b17acdfabcd8153759af5578ddaf8
- sha256sums = fa4a34c095429a84a68251270323dfa7159ee3532c2fe2dd8d49da449d275e89
- sha256sums = 0921338953f2359971a1431c3fc2d2a5f4d3ff050acce160e5cf21023eca9d0f
- sha256sums = 938fcde2ab0637164cc893bf21fec0f495495bea5690f00a0cc0bfd6b8c07f66
- sha256sums = 9057a23e755c4b218f67c71d481500ff32598f3f6de6a2f487d5b22412130c78
+ sha256sums = a50428eeac459c2ddadb6622c5cb927923344ee95ce9f917b9bd6a957c5b7c58
+ sha256sums = 5451e85ae2da9077f487a3e8ec9542f02eb1df87db92ee20a44cf1fa3da92dd9
+ sha256sums = 46bb9faf756b22b9862275d3ccff81bf5efa95f893620b49fac0c4da62d690d7
+ sha256sums = 2e86ad81026bb5a5aa4cf4af1b518f7b7e47eec7f92fb49afa5417131543f0c5
+ sha256sums = 7ab14c9db3021fe09e13c35be4a9509c7f585c147826279e853a7f1bffd22d89
+ sha256sums = 4efdca5f2f5026565eb93a8199290755634157996bbd3d506c2a3d514ed45472
+ sha256sums = 469db4138c52b33f6b5055a5615b137ea139f52d6535346eed902f0f09962bf0
pkgname = openafs-modules-dkms
diff --git a/0001-Temporary-fix-for-compilation-with-GCC-10.patch b/0001-Temporary-fix-for-compilation-with-GCC-10.patch
index f7aab0f3aa7b..3eef59eabab1 100644
--- a/0001-Temporary-fix-for-compilation-with-GCC-10.patch
+++ b/0001-Temporary-fix-for-compilation-with-GCC-10.patch
@@ -1,7 +1,7 @@
From 81c4f50914bd0f696a0a6c356982e97594bd2c77 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20La=C3=9F?= <lass@mail.uni-paderborn.de>
Date: Tue, 19 May 2020 16:17:01 +0200
-Subject: [PATCH 1/5] Temporary fix for compilation with GCC 10
+Subject: [PATCH 1/7] Temporary fix for compilation with GCC 10
See:
* https://bugs.gentoo.org/706738
@@ -29,5 +29,5 @@ index 5f0d73fc2..7cf761757 100644
else
case $AFS_SYSNAME in
--
-2.28.0
+2.30.0
diff --git a/0002-LINUX-5.8-Replace-kernel_setsockopt-with-new-funcs.patch b/0002-LINUX-5.8-Replace-kernel_setsockopt-with-new-funcs.patch
index 997983465aa4..cc0605a94862 100644
--- a/0002-LINUX-5.8-Replace-kernel_setsockopt-with-new-funcs.patch
+++ b/0002-LINUX-5.8-Replace-kernel_setsockopt-with-new-funcs.patch
@@ -1,7 +1,7 @@
From 858ce410250bae8c5043b8277aa3941dd528d577 Mon Sep 17 00:00:00 2001
From: Cheyenne Wills <cwills@sinenomine.net>
Date: Fri, 3 Jul 2020 10:33:51 -0600
-Subject: [PATCH 2/5] LINUX 5.8: Replace kernel_setsockopt with new funcs
+Subject: [PATCH 2/7] LINUX 5.8: Replace kernel_setsockopt with new funcs
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -155,5 +155,5 @@ index 9fbb563f3..50607c8f5 100644
return (osi_socket *)sockp;
}
--
-2.28.0
+2.30.0
diff --git a/0003-LINUX-5.8-do-not-set-name-field-in-backing_dev_info.patch b/0003-LINUX-5.8-do-not-set-name-field-in-backing_dev_info.patch
index 601866833c0e..3d69e990839d 100644
--- a/0003-LINUX-5.8-do-not-set-name-field-in-backing_dev_info.patch
+++ b/0003-LINUX-5.8-do-not-set-name-field-in-backing_dev_info.patch
@@ -1,7 +1,7 @@
From c8d51224d54275ac34f9bb4d817842e73e777b14 Mon Sep 17 00:00:00 2001
From: Cheyenne Wills <cwills@sinenomine.net>
Date: Fri, 3 Jul 2020 10:34:42 -0600
-Subject: [PATCH 3/5] LINUX 5.8: do not set name field in backing_dev_info
+Subject: [PATCH 3/7] LINUX 5.8: do not set name field in backing_dev_info
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -45,5 +45,5 @@ index 8bbb5f225..ca1d5c83b 100644
#else
/* used for inodes backing_dev_info field, also */
--
-2.28.0
+2.30.0
diff --git a/0004-LINUX-5.8-use-lru_cache_add.patch b/0004-LINUX-5.8-use-lru_cache_add.patch
index 2fb2b4924a34..7dc1396b3766 100644
--- a/0004-LINUX-5.8-use-lru_cache_add.patch
+++ b/0004-LINUX-5.8-use-lru_cache_add.patch
@@ -1,7 +1,7 @@
From db3408925dd69a70c14249a97d178d2762329f15 Mon Sep 17 00:00:00 2001
From: Cheyenne Wills <cwills@sinenomine.net>
Date: Fri, 3 Jul 2020 10:35:06 -0600
-Subject: [PATCH 4/5] LINUX 5.8: use lru_cache_add
+Subject: [PATCH 4/7] LINUX 5.8: use lru_cache_add
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -104,5 +104,5 @@ index 78ff48294..11d071806 100644
dnl e.g. ip_sock_set_mtu_discover, ip_sock_set_recverr
AC_CHECK_LINUX_FUNC([ip_sock_set],
--
-2.28.0
+2.30.0
diff --git a/0005-LINUX-5.9-Remove-HAVE_UNLOCKED_IOCTL-COMPAT_IOCTL.patch b/0005-LINUX-5.9-Remove-HAVE_UNLOCKED_IOCTL-COMPAT_IOCTL.patch
index 476ca39b7ff5..c2b13ab297e2 100644
--- a/0005-LINUX-5.9-Remove-HAVE_UNLOCKED_IOCTL-COMPAT_IOCTL.patch
+++ b/0005-LINUX-5.9-Remove-HAVE_UNLOCKED_IOCTL-COMPAT_IOCTL.patch
@@ -1,7 +1,7 @@
From e7f32efde6b4cf8c4a69768826c9fa2509bb98a2 Mon Sep 17 00:00:00 2001
From: Cheyenne Wills <cwills@sinenomine.net>
Date: Fri, 21 Aug 2020 10:37:51 -0600
-Subject: [PATCH 5/5] LINUX 5.9: Remove HAVE_UNLOCKED_IOCTL/COMPAT_IOCTL
+Subject: [PATCH 5/7] LINUX 5.9: Remove HAVE_UNLOCKED_IOCTL/COMPAT_IOCTL
Linux-5.9-rc1 commit 'fs: remove the HAVE_UNLOCKED_IOCTL and
HAVE_COMPAT_IOCTL defines' (4e24566a) removed the two referenced macros
@@ -165,5 +165,5 @@ index 36a4f685e..ba4f1e6af 100644
.open = afs_linux_open,
.flush = afs_linux_flush,
--
-2.28.0
+2.30.0
diff --git a/0006-rx-rx_InitHost-do-not-overwrite-RAND_bytes-rx_nextCi.patch b/0006-rx-rx_InitHost-do-not-overwrite-RAND_bytes-rx_nextCi.patch
new file mode 100644
index 000000000000..db2aaa64a358
--- /dev/null
+++ b/0006-rx-rx_InitHost-do-not-overwrite-RAND_bytes-rx_nextCi.patch
@@ -0,0 +1,39 @@
+From 0ed981c57bfdb48bd8aedd37ece2f409b33e9a74 Mon Sep 17 00:00:00 2001
+From: Jeffrey Altman <jaltman@auristor.com>
+Date: Thu, 14 Jan 2021 09:41:39 -0500
+Subject: [PATCH 6/7] rx: rx_InitHost do not overwrite RAND_bytes rx_nextCid
+
+39b165cdda941181845022c183fea1c7af7e4356 ("Move epoch and cid
+generation into the rx core") introduced the use of RAND_bytes()
+to generate the initial 'rx_nextCid' but failed to remove the
+
+ rx_nextCid = ((tv.tv_sec ^ tv.tv_usec) << RX_CIDSHIFT;
+
+assignment inherited from IBM/Transarc.
+
+At Thu, 14 Jan 2021 08:25:36 GMT the IBM inherited calculation
+overflows the value CID range. This triggers broken overflow
+logic in update_nextCid().
+
+Change-Id: Ib7283def1ded9792d394133a3969a6d86f3a6123
+---
+ src/rx/rx.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/src/rx/rx.c b/src/rx/rx.c
+index 244838d9c..e1e6d8fd6 100644
+--- a/src/rx/rx.c
++++ b/src/rx/rx.c
+@@ -621,9 +621,6 @@ rx_InitHost(u_int host, u_int port)
+ MUTEX_ENTER(&rx_quota_mutex);
+ rxi_dataQuota += rx_extraQuota; /* + extra pkts caller asked to rsrv */
+ MUTEX_EXIT(&rx_quota_mutex);
+- /* *Slightly* random start time for the cid. This is just to help
+- * out with the hashing function at the peer */
+- rx_nextCid = ((tv.tv_sec ^ tv.tv_usec) << RX_CIDSHIFT);
+ rx_connHashTable = (struct rx_connection **)htable;
+ rx_peerHashTable = (struct rx_peer **)ptable;
+
+--
+2.30.0
+
diff --git a/0007-rx-update_nextCid-overflow-handling-is-broken.patch b/0007-rx-update_nextCid-overflow-handling-is-broken.patch
new file mode 100644
index 000000000000..d5a351f9a1f8
--- /dev/null
+++ b/0007-rx-update_nextCid-overflow-handling-is-broken.patch
@@ -0,0 +1,52 @@
+From 99e01a0237ea3af6bf859ceeb2f53ed0755c75dd Mon Sep 17 00:00:00 2001
+From: Jeffrey Altman <jaltman@auristor.com>
+Date: Thu, 14 Jan 2021 09:57:13 -0500
+Subject: [PATCH 7/7] rx: update_nextCid overflow handling is broken
+
+The overflow handling in update_nextCid() produces a rx_nextCid
+value of 0x80000001 which itself is an overflow. When used
+to construct the first call of a new connection the connection
+id for the call becomes 0x80000002.
+
+If the same connection id is used for multiple connections from
+the same endpoint the accepting rx peer will be very confused.
+
+When authenticated connections are used, the CHALLENGE/RESPONSE
+will fail because of a mismatch in the connection's callNumber
+array.
+
+All communication from a broken initiator to any rx peer will
+fail.
+
+The incorrect overflow calculation was introduced by
+39b165cdda941181845022c183fea1c7af7e4356 ("Move epoch and cid
+generation into the rx core").
+
+This change corrects the overflow value to become
+
+ 1 << RX_CIDSHIFT
+
+Change-Id: If36e3aa581d557cc0f4d2d478f84a6593224c3cc
+---
+ src/rx/rx.c | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/src/rx/rx.c b/src/rx/rx.c
+index e1e6d8fd6..5d5953120 100644
+--- a/src/rx/rx.c
++++ b/src/rx/rx.c
+@@ -6651,9 +6651,8 @@ update_nextCid(void)
+ {
+ /* Overflow is technically undefined behavior; avoid it. */
+ if (rx_nextCid > MAX_AFS_INT32 - (1 << RX_CIDSHIFT))
+- rx_nextCid = -1 * ((MAX_AFS_INT32 / RX_CIDSHIFT) * RX_CIDSHIFT);
+- else
+- rx_nextCid += 1 << RX_CIDSHIFT;
++ rx_nextCid = 0;
++ rx_nextCid += 1 << RX_CIDSHIFT;
+ }
+
+ static void
+--
+2.30.0
+
diff --git a/PKGBUILD b/PKGBUILD
index 3404325512bc..61cf0fd179f6 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -7,7 +7,7 @@
pkgname=openafs-modules-dkms
_srcname=openafs
pkgver=1.8.6
-pkgrel=3
+pkgrel=4
pkgdesc="Kernel module for OpenAFS (dkms)"
arch=('i686' 'x86_64' 'armv7h')
url="http://www.openafs.org"
@@ -22,14 +22,18 @@ source=("http://openafs.org/dl/openafs/${pkgver}/${_srcname}-${pkgver}-src.tar.b
0002-LINUX-5.8-Replace-kernel_setsockopt-with-new-funcs.patch
0003-LINUX-5.8-do-not-set-name-field-in-backing_dev_info.patch
0004-LINUX-5.8-use-lru_cache_add.patch
- 0005-LINUX-5.9-Remove-HAVE_UNLOCKED_IOCTL-COMPAT_IOCTL.patch)
+ 0005-LINUX-5.9-Remove-HAVE_UNLOCKED_IOCTL-COMPAT_IOCTL.patch
+ 0006-rx-rx_InitHost-do-not-overwrite-RAND_bytes-rx_nextCi.patch
+ 0007-rx-update_nextCid-overflow-handling-is-broken.patch)
sha256sums=('8b4e9d3180f1ecd752753da17ac630df04eb7007c90a921a5f6403c0339d2945'
'5ea5e184f9b44f5ed45817d2b5a10149d15c8c54f49e0b5b4b773652673cb9b0'
- '604fc461acf66dc833baa434023320ab656b17acdfabcd8153759af5578ddaf8'
- 'fa4a34c095429a84a68251270323dfa7159ee3532c2fe2dd8d49da449d275e89'
- '0921338953f2359971a1431c3fc2d2a5f4d3ff050acce160e5cf21023eca9d0f'
- '938fcde2ab0637164cc893bf21fec0f495495bea5690f00a0cc0bfd6b8c07f66'
- '9057a23e755c4b218f67c71d481500ff32598f3f6de6a2f487d5b22412130c78')
+ 'a50428eeac459c2ddadb6622c5cb927923344ee95ce9f917b9bd6a957c5b7c58'
+ '5451e85ae2da9077f487a3e8ec9542f02eb1df87db92ee20a44cf1fa3da92dd9'
+ '46bb9faf756b22b9862275d3ccff81bf5efa95f893620b49fac0c4da62d690d7'
+ '2e86ad81026bb5a5aa4cf4af1b518f7b7e47eec7f92fb49afa5417131543f0c5'
+ '7ab14c9db3021fe09e13c35be4a9509c7f585c147826279e853a7f1bffd22d89'
+ '4efdca5f2f5026565eb93a8199290755634157996bbd3d506c2a3d514ed45472'
+ '469db4138c52b33f6b5055a5615b137ea139f52d6535346eed902f0f09962bf0')
prepare() {
cd "${srcdir}/${_srcname}-${pkgver}"
@@ -45,6 +49,12 @@ prepare() {
# Compatibility with Linux 5.9
patch -p1 < "${srcdir}"/0005-LINUX-5.9-Remove-HAVE_UNLOCKED_IOCTL-COMPAT_IOCTL.patch
+ # Fix RX bug triggered after 14.01.2021 08:25:36 UTC
+ # https://gerrit.openafs.org/#/c/14491/
+ # https://gerrit.openafs.org/#/c/14492/
+ patch -p1 < "${srcdir}"/0006-rx-rx_InitHost-do-not-overwrite-RAND_bytes-rx_nextCi.patch
+ patch -p1 < "${srcdir}"/0007-rx-update_nextCid-overflow-handling-is-broken.patch
+
# Only needed when changes to configure were made
./regen.sh -q
}