summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-05-20 11:21:07 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-05-20 11:21:07 -0400
commit78e03651849fd3e8aa9ab3288bc1d3726c4c6129 (patch)
tree4537d358985b4d9ad152bb56321a3b5e88788955 /lib
parenta188339ca5a396acc588e5851ed7e19f66b0ebd9 (diff)
parent6a0a923dfa1480df41fb486323b8375e387d516f (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller:1) Use after free in __dev_map_entry_free(), from Eric Dumazet. 1) Use after free in __dev_map_entry_free(), from Eric Dumazet. 2) Fix TCP retransmission timestamps on passive Fast Open, from Yuchung Cheng. 3) Orphan NFC, we'll take the patches directly into my tree. From Johannes Berg. 4) We can't recycle cloned TCP skbs, from Eric Dumazet. 5) Some flow dissector bpf test fixes, from Stanislav Fomichev. 6) Fix RCU marking and warnings in rhashtable, from Herbert Xu. 7) Fix some potential fib6 leaks, from Eric Dumazet. 8) Fix a _decode_session4 uninitialized memory read bug fix that got lost in a merge. From Florian Westphal. 9) Fix ipv6 source address routing wrt. exception route entries, from Wei Wang. 10) The netdev_xmit_more() conversion was not done %100 properly in mlx5 driver, fix from Tariq Toukan. 11) Clean up botched merge on netfilter kselftest, from Florian Westphal. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (74 commits) of_net: fix of_get_mac_address retval if compiled without CONFIG_OF net: fix kernel-doc warnings for socket.c net: Treat sock->sk_drops as an unsigned int when printing kselftests: netfilter: fix leftover net/net-next merge conflict mlxsw: core: Prevent reading unsupported slave address from SFP EEPROM mlxsw: core: Prevent QSFP module initialization for old hardware vsock/virtio: Initialize core virtio vsock before registering the driver net/mlx5e: Fix possible modify header actions memory leak net/mlx5e: Fix no rewrite fields with the same match net/mlx5e: Additional check for flow destination comparison net/mlx5e: Add missing ethtool driver info for representors net/mlx5e: Fix number of vports for ingress ACL configuration net/mlx5e: Fix ethtool rxfh commands when CONFIG_MLX5_EN_RXNFC is disabled net/mlx5e: Fix wrong xmit_more application net/mlx5: Fix peer pf disable hca command net/mlx5: E-Switch, Correct type to u16 for vport_num and int for vport_index net/mlx5: Add meaningful return codes to status_to_err function net/mlx5: Imply MLXFW in mlx5_core Revert "tipc: fix modprobe tipc failed after switch order of device registration" vsock/virtio: free packets during the socket release ...
Diffstat (limited to 'lib')
-rw-r--r--lib/random32.c4
-rw-r--r--lib/rhashtable.c33
2 files changed, 19 insertions, 18 deletions
diff --git a/lib/random32.c b/lib/random32.c
index 4aaa76404d56..763b920a6206 100644
--- a/lib/random32.c
+++ b/lib/random32.c
@@ -171,9 +171,9 @@ static void prandom_seed_early(struct rnd_state *state, u32 seed,
171 171
172/** 172/**
173 * prandom_seed - add entropy to pseudo random number generator 173 * prandom_seed - add entropy to pseudo random number generator
174 * @seed: seed value 174 * @entropy: entropy value
175 * 175 *
176 * Add some additional seeding to the prandom pool. 176 * Add some additional entropy to the prandom pool.
177 */ 177 */
178void prandom_seed(u32 entropy) 178void prandom_seed(u32 entropy)
179{ 179{
diff --git a/lib/rhashtable.c b/lib/rhashtable.c
index 6529fe1b45c1..935ec80f213f 100644
--- a/lib/rhashtable.c
+++ b/lib/rhashtable.c
@@ -34,7 +34,7 @@
34 34
35union nested_table { 35union nested_table {
36 union nested_table __rcu *table; 36 union nested_table __rcu *table;
37 struct rhash_lock_head __rcu *bucket; 37 struct rhash_lock_head *bucket;
38}; 38};
39 39
40static u32 head_hashfn(struct rhashtable *ht, 40static u32 head_hashfn(struct rhashtable *ht,
@@ -131,7 +131,7 @@ static union nested_table *nested_table_alloc(struct rhashtable *ht,
131 INIT_RHT_NULLS_HEAD(ntbl[i].bucket); 131 INIT_RHT_NULLS_HEAD(ntbl[i].bucket);
132 } 132 }
133 133
134 if (cmpxchg(prev, NULL, ntbl) == NULL) 134 if (cmpxchg((union nested_table **)prev, NULL, ntbl) == NULL)
135 return ntbl; 135 return ntbl;
136 /* Raced with another thread. */ 136 /* Raced with another thread. */
137 kfree(ntbl); 137 kfree(ntbl);
@@ -216,7 +216,7 @@ static struct bucket_table *rhashtable_last_table(struct rhashtable *ht,
216} 216}
217 217
218static int rhashtable_rehash_one(struct rhashtable *ht, 218static int rhashtable_rehash_one(struct rhashtable *ht,
219 struct rhash_lock_head __rcu **bkt, 219 struct rhash_lock_head **bkt,
220 unsigned int old_hash) 220 unsigned int old_hash)
221{ 221{
222 struct bucket_table *old_tbl = rht_dereference(ht->tbl, ht); 222 struct bucket_table *old_tbl = rht_dereference(ht->tbl, ht);
@@ -269,7 +269,7 @@ static int rhashtable_rehash_chain(struct rhashtable *ht,
269 unsigned int old_hash) 269 unsigned int old_hash)
270{ 270{
271 struct bucket_table *old_tbl = rht_dereference(ht->tbl, ht); 271 struct bucket_table *old_tbl = rht_dereference(ht->tbl, ht);
272 struct rhash_lock_head __rcu **bkt = rht_bucket_var(old_tbl, old_hash); 272 struct rhash_lock_head **bkt = rht_bucket_var(old_tbl, old_hash);
273 int err; 273 int err;
274 274
275 if (!bkt) 275 if (!bkt)
@@ -296,7 +296,8 @@ static int rhashtable_rehash_attach(struct rhashtable *ht,
296 * rcu_assign_pointer(). 296 * rcu_assign_pointer().
297 */ 297 */
298 298
299 if (cmpxchg(&old_tbl->future_tbl, NULL, new_tbl) != NULL) 299 if (cmpxchg((struct bucket_table **)&old_tbl->future_tbl, NULL,
300 new_tbl) != NULL)
300 return -EEXIST; 301 return -EEXIST;
301 302
302 return 0; 303 return 0;
@@ -478,7 +479,7 @@ fail:
478} 479}
479 480
480static void *rhashtable_lookup_one(struct rhashtable *ht, 481static void *rhashtable_lookup_one(struct rhashtable *ht,
481 struct rhash_lock_head __rcu **bkt, 482 struct rhash_lock_head **bkt,
482 struct bucket_table *tbl, unsigned int hash, 483 struct bucket_table *tbl, unsigned int hash,
483 const void *key, struct rhash_head *obj) 484 const void *key, struct rhash_head *obj)
484{ 485{
@@ -529,7 +530,7 @@ static void *rhashtable_lookup_one(struct rhashtable *ht,
529} 530}
530 531
531static struct bucket_table *rhashtable_insert_one(struct rhashtable *ht, 532static struct bucket_table *rhashtable_insert_one(struct rhashtable *ht,
532 struct rhash_lock_head __rcu **bkt, 533 struct rhash_lock_head **bkt,
533 struct bucket_table *tbl, 534 struct bucket_table *tbl,
534 unsigned int hash, 535 unsigned int hash,
535 struct rhash_head *obj, 536 struct rhash_head *obj,
@@ -584,7 +585,7 @@ static void *rhashtable_try_insert(struct rhashtable *ht, const void *key,
584{ 585{
585 struct bucket_table *new_tbl; 586 struct bucket_table *new_tbl;
586 struct bucket_table *tbl; 587 struct bucket_table *tbl;
587 struct rhash_lock_head __rcu **bkt; 588 struct rhash_lock_head **bkt;
588 unsigned int hash; 589 unsigned int hash;
589 void *data; 590 void *data;
590 591
@@ -1166,8 +1167,8 @@ void rhashtable_destroy(struct rhashtable *ht)
1166} 1167}
1167EXPORT_SYMBOL_GPL(rhashtable_destroy); 1168EXPORT_SYMBOL_GPL(rhashtable_destroy);
1168 1169
1169struct rhash_lock_head __rcu **__rht_bucket_nested(const struct bucket_table *tbl, 1170struct rhash_lock_head **__rht_bucket_nested(const struct bucket_table *tbl,
1170 unsigned int hash) 1171 unsigned int hash)
1171{ 1172{
1172 const unsigned int shift = PAGE_SHIFT - ilog2(sizeof(void *)); 1173 const unsigned int shift = PAGE_SHIFT - ilog2(sizeof(void *));
1173 unsigned int index = hash & ((1 << tbl->nest) - 1); 1174 unsigned int index = hash & ((1 << tbl->nest) - 1);
@@ -1195,10 +1196,10 @@ struct rhash_lock_head __rcu **__rht_bucket_nested(const struct bucket_table *tb
1195} 1196}
1196EXPORT_SYMBOL_GPL(__rht_bucket_nested); 1197EXPORT_SYMBOL_GPL(__rht_bucket_nested);
1197 1198
1198struct rhash_lock_head __rcu **rht_bucket_nested(const struct bucket_table *tbl, 1199struct rhash_lock_head **rht_bucket_nested(const struct bucket_table *tbl,
1199 unsigned int hash) 1200 unsigned int hash)
1200{ 1201{
1201 static struct rhash_lock_head __rcu *rhnull; 1202 static struct rhash_lock_head *rhnull;
1202 1203
1203 if (!rhnull) 1204 if (!rhnull)
1204 INIT_RHT_NULLS_HEAD(rhnull); 1205 INIT_RHT_NULLS_HEAD(rhnull);
@@ -1206,9 +1207,9 @@ struct rhash_lock_head __rcu **rht_bucket_nested(const struct bucket_table *tbl,
1206} 1207}
1207EXPORT_SYMBOL_GPL(rht_bucket_nested); 1208EXPORT_SYMBOL_GPL(rht_bucket_nested);
1208 1209
1209struct rhash_lock_head __rcu **rht_bucket_nested_insert(struct rhashtable *ht, 1210struct rhash_lock_head **rht_bucket_nested_insert(struct rhashtable *ht,
1210 struct bucket_table *tbl, 1211 struct bucket_table *tbl,
1211 unsigned int hash) 1212 unsigned int hash)
1212{ 1213{
1213 const unsigned int shift = PAGE_SHIFT - ilog2(sizeof(void *)); 1214 const unsigned int shift = PAGE_SHIFT - ilog2(sizeof(void *));
1214 unsigned int index = hash & ((1 << tbl->nest) - 1); 1215 unsigned int index = hash & ((1 << tbl->nest) - 1);