summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Lass2021-01-14 21:15:26 +0100
committerMichael Lass2021-01-14 21:15:26 +0100
commit72f805106b205c02bb34622f75bdd69406053026 (patch)
treef0548f282ce168ddd4c3137d1a140f50189be67c
parent87324038e50498205be512e940f29664a208d189 (diff)
downloadaur-72f805106b205c02bb34622f75bdd69406053026.tar.gz
Update patches for RX sequence ID bug
-rw-r--r--.SRCINFO18
-rw-r--r--0001-Temporary-fix-for-compilation-with-GCC-10.patch2
-rw-r--r--0002-LINUX-5.8-Replace-kernel_setsockopt-with-new-funcs.patch2
-rw-r--r--0003-LINUX-5.8-do-not-set-name-field-in-backing_dev_info.patch2
-rw-r--r--0004-LINUX-5.8-use-lru_cache_add.patch2
-rw-r--r--0005-LINUX-5.9-Remove-HAVE_UNLOCKED_IOCTL-COMPAT_IOCTL.patch2
-rw-r--r--0006-rx-rx_InitHost-do-not-overwrite-RAND_bytes-rx_nextCi.patch15
-rw-r--r--0007-rx-update_nextCid-overflow-handling-is-broken.patch26
-rw-r--r--0008-Remove-overflow-check-from-update_nextCid.patch49
-rw-r--r--PKGBUILD26
10 files changed, 109 insertions, 35 deletions
diff --git a/.SRCINFO b/.SRCINFO
index f0e9558be8e..da8ba69b949 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = openafs-modules-dkms
pkgdesc = Kernel module for OpenAFS (dkms)
pkgver = 1.8.6
- pkgrel = 4
+ pkgrel = 5
url = http://www.openafs.org
arch = i686
arch = x86_64
@@ -24,15 +24,17 @@ pkgbase = openafs-modules-dkms
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
+ source = 0008-Remove-overflow-check-from-update_nextCid.patch
sha256sums = 8b4e9d3180f1ecd752753da17ac630df04eb7007c90a921a5f6403c0339d2945
sha256sums = 5ea5e184f9b44f5ed45817d2b5a10149d15c8c54f49e0b5b4b773652673cb9b0
- sha256sums = a50428eeac459c2ddadb6622c5cb927923344ee95ce9f917b9bd6a957c5b7c58
- sha256sums = 5451e85ae2da9077f487a3e8ec9542f02eb1df87db92ee20a44cf1fa3da92dd9
- sha256sums = 46bb9faf756b22b9862275d3ccff81bf5efa95f893620b49fac0c4da62d690d7
- sha256sums = 2e86ad81026bb5a5aa4cf4af1b518f7b7e47eec7f92fb49afa5417131543f0c5
- sha256sums = 7ab14c9db3021fe09e13c35be4a9509c7f585c147826279e853a7f1bffd22d89
- sha256sums = 4efdca5f2f5026565eb93a8199290755634157996bbd3d506c2a3d514ed45472
- sha256sums = 469db4138c52b33f6b5055a5615b137ea139f52d6535346eed902f0f09962bf0
+ sha256sums = 8f4145f5eaf148b231a06aa6fe4a0271fa3c63506bc4e8e504984bb57326d054
+ sha256sums = cd2bb4125b7995f547767abced93a8e0ffd39ceec2aafda6a87abb11c04ef64f
+ sha256sums = 0f147adc83adfc959eb20794410df9cea339253ad79175bc22b4cdb6e21b8c3d
+ sha256sums = 4987b2800e18d890c7f17f4f0866812bbf9b9d9a2b5f97a1974d119106306b17
+ sha256sums = 50ffd1efbbc6f6977e900cd8623988168d67d821c78def27fae6312d920bc901
+ sha256sums = 3154052cc77b32ccafc5be86c1540b5253de2a1de5f3a87bbe6a771946bc45c1
+ sha256sums = 714e862d31afbcf49b3a1d711fccb64c269153a73e7bfd0b0483dbae109fd177
+ sha256sums = 00db4b504667f9f3182cf35ed48fb0ef8f16b5d6e97df5454efb2b3e5d914111
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 3eef59eabab..75eb808b4c5 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/7] Temporary fix for compilation with GCC 10
+Subject: [PATCH 1/8] Temporary fix for compilation with GCC 10
See:
* https://bugs.gentoo.org/706738
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 cc0605a9486..5f904255727 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/7] LINUX 5.8: Replace kernel_setsockopt with new funcs
+Subject: [PATCH 2/8] LINUX 5.8: Replace kernel_setsockopt with new funcs
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
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 3d69e990839..2ab84fc8106 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/7] LINUX 5.8: do not set name field in backing_dev_info
+Subject: [PATCH 3/8] 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
diff --git a/0004-LINUX-5.8-use-lru_cache_add.patch b/0004-LINUX-5.8-use-lru_cache_add.patch
index 7dc1396b376..65b0b2c923a 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/7] LINUX 5.8: use lru_cache_add
+Subject: [PATCH 4/8] LINUX 5.8: use lru_cache_add
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
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 c2b13ab297e..1a04cc6166a 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/7] LINUX 5.9: Remove HAVE_UNLOCKED_IOCTL/COMPAT_IOCTL
+Subject: [PATCH 5/8] 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
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
index db2aaa64a35..7b689815705 100644
--- 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
@@ -1,7 +1,7 @@
-From 0ed981c57bfdb48bd8aedd37ece2f409b33e9a74 Mon Sep 17 00:00:00 2001
+From ce893e8479e87dce4252e5a1c7771381689625be 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
+Subject: [PATCH 6/8] 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()
@@ -15,7 +15,16 @@ 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
+Reviewed-on: https://gerrit.openafs.org/14491
+Reviewed-by: Andrew Deason <adeason@sinenomine.net>
+Tested-by: Andrew Deason <adeason@sinenomine.net>
+Reviewed-by: Jeffrey Hutzelman <jhutz@cmu.edu>
+Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
+Tested-by: Mark Vitale <mvitale@sinenomine.net>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit a3bc7ff1501d51ceb3b39d9caed62c530a804473)
+
+Change-Id: If5f7d4ba1cacc6978c83fd512653fbaa0c1559d8
---
src/rx/rx.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/0007-rx-update_nextCid-overflow-handling-is-broken.patch b/0007-rx-update_nextCid-overflow-handling-is-broken.patch
index d5a351f9a1f..1b17517095f 100644
--- a/0007-rx-update_nextCid-overflow-handling-is-broken.patch
+++ b/0007-rx-update_nextCid-overflow-handling-is-broken.patch
@@ -1,12 +1,14 @@
-From 99e01a0237ea3af6bf859ceeb2f53ed0755c75dd Mon Sep 17 00:00:00 2001
+From 270097d094d7dd9576f4808cd3d6c937ba8e053c 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
+Subject: [PATCH 7/8] 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.
+value of 0x80000001 which itself is out of the valid range. When
+used to construct the first call of a new connection the connection
+id for the call becomes 0x80000002, and all subsequent connections
+also trigger the overflow handling and thus also receive connection
+id 0x80000002.
If the same connection id is used for multiple connections from
the same endpoint the accepting rx peer will be very confused.
@@ -15,8 +17,10 @@ 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.
+If an initiator makes only a single connection to a given rx peer,
+that connection would succeed, but once multiple connections are
+initiated all communication from a broken initiator to any rx peer
+will fail.
The incorrect overflow calculation was introduced by
39b165cdda941181845022c183fea1c7af7e4356 ("Move epoch and cid
@@ -26,7 +30,13 @@ This change corrects the overflow value to become
1 << RX_CIDSHIFT
-Change-Id: If36e3aa581d557cc0f4d2d478f84a6593224c3cc
+Reviewed-on: https://gerrit.openafs.org/14492
+Reviewed-by: Andrew Deason <adeason@sinenomine.net>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+Tested-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit 2c0a3901cbfcb231b7b67eb0899a3133516f33c8)
+
+Change-Id: I74d70706ddf99022bed639891cb610fba9ef863d
---
src/rx/rx.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/0008-Remove-overflow-check-from-update_nextCid.patch b/0008-Remove-overflow-check-from-update_nextCid.patch
new file mode 100644
index 00000000000..4c44e9d153c
--- /dev/null
+++ b/0008-Remove-overflow-check-from-update_nextCid.patch
@@ -0,0 +1,49 @@
+From 12ac34bc93ca18dbb5f0f57744a70f1a072599b8 Mon Sep 17 00:00:00 2001
+From: Benjamin Kaduk <kaduk@mit.edu>
+Date: Thu, 14 Jan 2021 10:20:59 -0800
+Subject: [PATCH 8/8] Remove overflow check from update_nextCid
+
+The rx_nextCid global has been an unsigned type since
+http://gerrit.openafs.org/11106 (which was actually merged before
+the refactoring of overflow check to avoid signed integer overflow)
+and thus there is no need to avoid signed overflow. The per-connection
+cid has been unsigned since the IBM import.
+
+The natural unsigned behavior on overflow of wrapping is the desired
+behvaior here, so just remove the extra logic and always increment.
+
+Reviewed-on: https://gerrit.openafs.org/14496
+Reviewed-by: Jeffrey Hutzelman <jhutz@cmu.edu>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+Tested-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit 43ef1f2a5d80aa1c3f5b4831ada8e776ac0c7d13)
+
+Change-Id: I64fabe5229039f7af040902ed2e6f03dba7bc14d
+---
+ src/rx/rx.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/src/rx/rx.c b/src/rx/rx.c
+index 5d5953120..c713fefd8 100644
+--- a/src/rx/rx.c
++++ b/src/rx/rx.c
+@@ -6644,14 +6644,12 @@ rxi_CancelGrowMTUEvent(struct rx_call *call)
+ }
+
+ /*
+- * Increment the counter for the next connection ID, handling overflow.
++ * Increment the counter for the next connection ID.
++ * Wrapping on unsigned integer overflow is the intended behavior.
+ */
+ static void
+ update_nextCid(void)
+ {
+- /* Overflow is technically undefined behavior; avoid it. */
+- if (rx_nextCid > MAX_AFS_INT32 - (1 << RX_CIDSHIFT))
+- rx_nextCid = 0;
+ rx_nextCid += 1 << RX_CIDSHIFT;
+ }
+
+--
+2.30.0
+
diff --git a/PKGBUILD b/PKGBUILD
index 61cf0fd179f..d441e3ffd40 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -7,7 +7,7 @@
pkgname=openafs-modules-dkms
_srcname=openafs
pkgver=1.8.6
-pkgrel=4
+pkgrel=5
pkgdesc="Kernel module for OpenAFS (dkms)"
arch=('i686' 'x86_64' 'armv7h')
url="http://www.openafs.org"
@@ -24,16 +24,18 @@ source=("http://openafs.org/dl/openafs/${pkgver}/${_srcname}-${pkgver}-src.tar.b
0004-LINUX-5.8-use-lru_cache_add.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)
+ 0007-rx-update_nextCid-overflow-handling-is-broken.patch
+ 0008-Remove-overflow-check-from-update_nextCid.patch)
sha256sums=('8b4e9d3180f1ecd752753da17ac630df04eb7007c90a921a5f6403c0339d2945'
'5ea5e184f9b44f5ed45817d2b5a10149d15c8c54f49e0b5b4b773652673cb9b0'
- 'a50428eeac459c2ddadb6622c5cb927923344ee95ce9f917b9bd6a957c5b7c58'
- '5451e85ae2da9077f487a3e8ec9542f02eb1df87db92ee20a44cf1fa3da92dd9'
- '46bb9faf756b22b9862275d3ccff81bf5efa95f893620b49fac0c4da62d690d7'
- '2e86ad81026bb5a5aa4cf4af1b518f7b7e47eec7f92fb49afa5417131543f0c5'
- '7ab14c9db3021fe09e13c35be4a9509c7f585c147826279e853a7f1bffd22d89'
- '4efdca5f2f5026565eb93a8199290755634157996bbd3d506c2a3d514ed45472'
- '469db4138c52b33f6b5055a5615b137ea139f52d6535346eed902f0f09962bf0')
+ '8f4145f5eaf148b231a06aa6fe4a0271fa3c63506bc4e8e504984bb57326d054'
+ 'cd2bb4125b7995f547767abced93a8e0ffd39ceec2aafda6a87abb11c04ef64f'
+ '0f147adc83adfc959eb20794410df9cea339253ad79175bc22b4cdb6e21b8c3d'
+ '4987b2800e18d890c7f17f4f0866812bbf9b9d9a2b5f97a1974d119106306b17'
+ '50ffd1efbbc6f6977e900cd8623988168d67d821c78def27fae6312d920bc901'
+ '3154052cc77b32ccafc5be86c1540b5253de2a1de5f3a87bbe6a771946bc45c1'
+ '714e862d31afbcf49b3a1d711fccb64c269153a73e7bfd0b0483dbae109fd177'
+ '00db4b504667f9f3182cf35ed48fb0ef8f16b5d6e97df5454efb2b3e5d914111')
prepare() {
cd "${srcdir}/${_srcname}-${pkgver}"
@@ -50,10 +52,12 @@ prepare() {
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/
+ # https://gerrit.openafs.org/#/c/14493/
+ # https://gerrit.openafs.org/#/c/14494/
+ # https://gerrit.openafs.org/#/c/14497/
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
+ patch -p1 < "${srcdir}"/0008-Remove-overflow-check-from-update_nextCid.patch
# Only needed when changes to configure were made
./regen.sh -q