diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 10:06:00 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 10:06:00 +0000 |
commit | b15a952c52a6825376d3e7f6c1bf5c886c6d8b74 (patch) | |
tree | 1500f2f8f276908a36d8126cb632c0d6b1276764 /debian/patches-rt/0182-xfrm-Use-sequence-counter-with-associated-spinlock.patch | |
parent | Adding upstream version 5.10.209. (diff) | |
download | linux-b15a952c52a6825376d3e7f6c1bf5c886c6d8b74.tar.xz linux-b15a952c52a6825376d3e7f6c1bf5c886c6d8b74.zip |
Adding debian version 5.10.209-2.debian/5.10.209-2debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/patches-rt/0182-xfrm-Use-sequence-counter-with-associated-spinlock.patch')
-rw-r--r-- | debian/patches-rt/0182-xfrm-Use-sequence-counter-with-associated-spinlock.patch | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/debian/patches-rt/0182-xfrm-Use-sequence-counter-with-associated-spinlock.patch b/debian/patches-rt/0182-xfrm-Use-sequence-counter-with-associated-spinlock.patch new file mode 100644 index 000000000..abce9d9d0 --- /dev/null +++ b/debian/patches-rt/0182-xfrm-Use-sequence-counter-with-associated-spinlock.patch @@ -0,0 +1,46 @@ +From 17aae888f2940f55065824bd7c267df06be47fbb Mon Sep 17 00:00:00 2001 +From: "Ahmed S. Darwish" <a.darwish@linutronix.de> +Date: Wed, 10 Jun 2020 12:53:22 +0200 +Subject: [PATCH 182/323] xfrm: Use sequence counter with associated spinlock +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.204-rt100.tar.xz + +A sequence counter write side critical section must be protected by some +form of locking to serialize writers. A plain seqcount_t does not +contain the information of which lock must be held when entering a write +side critical section. + +Use the new seqcount_spinlock_t data type, which allows to associate a +spinlock with the sequence counter. This enables lockdep to verify that +the spinlock used for writer serialization is held when the write side +critical section is entered. + +If lockdep is disabled this lock association is compiled out and has +neither storage size nor runtime overhead. + +Upstream-status: The xfrm locking used for seqcoun writer serialization +appears to be broken. If that's the case, a proper fix will need to be +submitted upstream. (e.g. make the seqcount per network namespace?) + +Signed-off-by: Ahmed S. Darwish <a.darwish@linutronix.de> +Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> +--- + net/xfrm/xfrm_state.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c +index ba73014805a4..14e1f36bdda5 100644 +--- a/net/xfrm/xfrm_state.c ++++ b/net/xfrm/xfrm_state.c +@@ -2691,7 +2691,8 @@ int __net_init xfrm_state_init(struct net *net) + net->xfrm.state_num = 0; + INIT_WORK(&net->xfrm.state_hash_work, xfrm_hash_resize); + spin_lock_init(&net->xfrm.xfrm_state_lock); +- seqcount_init(&net->xfrm.xfrm_state_hash_generation); ++ seqcount_spinlock_init(&net->xfrm.xfrm_state_hash_generation, ++ &net->xfrm.xfrm_state_lock); + return 0; + + out_byspi: +-- +2.43.0 + |