diff options
author | Paul Gortmaker <paul.gortmaker@windriver.com> | 2020-08-21 12:59:42 -0400 |
---|---|---|
committer | Paul Gortmaker <paul.gortmaker@windriver.com> | 2020-08-21 12:59:42 -0400 |
commit | c7fed1fd100b2adf7cef38a3a769b369a10bc447 (patch) | |
tree | 9bd4cb2a69f8f7091c11d9988b16be32babd9800 | |
parent | 3e442181ea2070f1739526aa589683a6f8caae75 (diff) | |
download | longterm-queue-5.2-c7fed1fd100b2adf7cef38a3a769b369a10bc447.tar.gz |
rhastable: drop commit n/a for v5.2.x-stable
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-rw-r--r-- | queue/rhashtable-Fix-unprotected-RCU-dereference-in-__rht_.patch | 80 | ||||
-rw-r--r-- | queue/series | 1 |
2 files changed, 0 insertions, 81 deletions
diff --git a/queue/rhashtable-Fix-unprotected-RCU-dereference-in-__rht_.patch b/queue/rhashtable-Fix-unprotected-RCU-dereference-in-__rht_.patch deleted file mode 100644 index b5cd036b..00000000 --- a/queue/rhashtable-Fix-unprotected-RCU-dereference-in-__rht_.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 1748f6a2cbc4694523f16da1c892b59861045b9d Mon Sep 17 00:00:00 2001 -From: Herbert Xu <herbert@gondor.apana.org.au> -Date: Fri, 24 Jul 2020 20:12:53 +1000 -Subject: [PATCH] rhashtable: Fix unprotected RCU dereference in __rht_ptr - -commit 1748f6a2cbc4694523f16da1c892b59861045b9d upstream. - -The rcu_dereference call in rht_ptr_rcu is completely bogus because -we've already dereferenced the value in __rht_ptr and operated on it. -This causes potential double readings which could be fatal. The RCU -dereference must occur prior to the comparison in __rht_ptr. - -This patch changes the order of RCU dereference so that it is done -first and the result is then fed to __rht_ptr. The RCU marking -changes have been minimised using casts which will be removed in -a follow-up patch. - -Fixes: ba6306e3f648 ("rhashtable: Remove RCU marking from...") -Reported-by: "Gong, Sishuai" <sishuai@purdue.edu> -Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> -Signed-off-by: David S. Miller <davem@davemloft.net> - -diff --git a/include/linux/rhashtable.h b/include/linux/rhashtable.h -index d3432ee65de7..b8feb5da7c5a 100644 ---- a/include/linux/rhashtable.h -+++ b/include/linux/rhashtable.h -@@ -349,11 +349,11 @@ static inline void rht_unlock(struct bucket_table *tbl, - local_bh_enable(); - } - --static inline struct rhash_head __rcu *__rht_ptr( -- struct rhash_lock_head *const *bkt) -+static inline struct rhash_head *__rht_ptr( -+ struct rhash_lock_head *p, struct rhash_lock_head __rcu *const *bkt) - { -- return (struct rhash_head __rcu *) -- ((unsigned long)*bkt & ~BIT(0) ?: -+ return (struct rhash_head *) -+ ((unsigned long)p & ~BIT(0) ?: - (unsigned long)RHT_NULLS_MARKER(bkt)); - } - -@@ -365,25 +365,26 @@ static inline struct rhash_head __rcu *__rht_ptr( - * access is guaranteed, such as when destroying the table. - */ - static inline struct rhash_head *rht_ptr_rcu( -- struct rhash_lock_head *const *bkt) -+ struct rhash_lock_head *const *p) - { -- struct rhash_head __rcu *p = __rht_ptr(bkt); -- -- return rcu_dereference(p); -+ struct rhash_lock_head __rcu *const *bkt = (void *)p; -+ return __rht_ptr(rcu_dereference(*bkt), bkt); - } - - static inline struct rhash_head *rht_ptr( -- struct rhash_lock_head *const *bkt, -+ struct rhash_lock_head *const *p, - struct bucket_table *tbl, - unsigned int hash) - { -- return rht_dereference_bucket(__rht_ptr(bkt), tbl, hash); -+ struct rhash_lock_head __rcu *const *bkt = (void *)p; -+ return __rht_ptr(rht_dereference_bucket(*bkt, tbl, hash), bkt); - } - - static inline struct rhash_head *rht_ptr_exclusive( -- struct rhash_lock_head *const *bkt) -+ struct rhash_lock_head *const *p) - { -- return rcu_dereference_protected(__rht_ptr(bkt), 1); -+ struct rhash_lock_head __rcu *const *bkt = (void *)p; -+ return __rht_ptr(rcu_dereference_protected(*bkt, 1), bkt); - } - - static inline void rht_assign_locked(struct rhash_lock_head **bkt, --- -2.27.0 - diff --git a/queue/series b/queue/series index d1ada38c..163b87a9 100644 --- a/queue/series +++ b/queue/series @@ -34,7 +34,6 @@ net-mlx5-Verify-Hardware-supports-requested-ptp-func.patch net-mlx5e-Modify-uplink-state-on-interface-up-down.patch net-lan78xx-add-missing-endpoint-sanity-check.patch net-lan78xx-fix-transfer-buffer-memory-leak.patch -rhashtable-Fix-unprotected-RCU-dereference-in-__rht_.patch mlx4-disable-device-on-shutdown.patch mlxsw-core-Increase-scope-of-RCU-read-side-critical-.patch mlxsw-core-Free-EMAD-transactions-using-kfree_rcu.patch |