mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-17 03:58:36 +00:00
ipv4: fix lockdep splat in rt_cache_seq_show
After commit f2c31e32b3
(fix NULL dereferences in check_peer_redir()),
dst_get_neighbour() should be guarded by rcu_read_lock() /
rcu_read_unlock() section.
Reported-by: Miles Lane <miles.lane@gmail.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
f7e57044ee
commit
218fa90f07
1 changed files with 6 additions and 2 deletions
|
@ -417,9 +417,13 @@ static int rt_cache_seq_show(struct seq_file *seq, void *v)
|
||||||
else {
|
else {
|
||||||
struct rtable *r = v;
|
struct rtable *r = v;
|
||||||
struct neighbour *n;
|
struct neighbour *n;
|
||||||
int len;
|
int len, HHUptod;
|
||||||
|
|
||||||
|
rcu_read_lock();
|
||||||
n = dst_get_neighbour(&r->dst);
|
n = dst_get_neighbour(&r->dst);
|
||||||
|
HHUptod = (n && (n->nud_state & NUD_CONNECTED)) ? 1 : 0;
|
||||||
|
rcu_read_unlock();
|
||||||
|
|
||||||
seq_printf(seq, "%s\t%08X\t%08X\t%8X\t%d\t%u\t%d\t"
|
seq_printf(seq, "%s\t%08X\t%08X\t%8X\t%d\t%u\t%d\t"
|
||||||
"%08X\t%d\t%u\t%u\t%02X\t%d\t%1d\t%08X%n",
|
"%08X\t%d\t%u\t%u\t%02X\t%d\t%1d\t%08X%n",
|
||||||
r->dst.dev ? r->dst.dev->name : "*",
|
r->dst.dev ? r->dst.dev->name : "*",
|
||||||
|
@ -433,7 +437,7 @@ static int rt_cache_seq_show(struct seq_file *seq, void *v)
|
||||||
dst_metric(&r->dst, RTAX_RTTVAR)),
|
dst_metric(&r->dst, RTAX_RTTVAR)),
|
||||||
r->rt_key_tos,
|
r->rt_key_tos,
|
||||||
-1,
|
-1,
|
||||||
(n && (n->nud_state & NUD_CONNECTED)) ? 1 : 0,
|
HHUptod,
|
||||||
r->rt_spec_dst, &len);
|
r->rt_spec_dst, &len);
|
||||||
|
|
||||||
seq_printf(seq, "%*s\n", 127 - len, "");
|
seq_printf(seq, "%*s\n", 127 - len, "");
|
||||||
|
|
Loading…
Add table
Reference in a new issue