diff options
author | 2023-07-08 14:59:10 +0800 | |
---|---|---|
committer | 2023-07-09 11:19:01 +0100 | |
commit | 06a0716949c22e2aefb648526580671197151acc (patch) | |
tree | f43fff41c176361149ebbd2ac844578ab0bcac0f /tools/perf/scripts/python/exported-sql-viewer.py | |
parent | udp6: fix udp6_ehashfn() typo (diff) | |
download | wireguard-linux-06a0716949c22e2aefb648526580671197151acc.tar.xz wireguard-linux-06a0716949c22e2aefb648526580671197151acc.zip |
ipv6/addrconf: fix a potential refcount underflow for idev
Now in addrconf_mod_rs_timer(), reference idev depends on whether
rs_timer is not pending. Then modify rs_timer timeout.
There is a time gap in [1], during which if the pending rs_timer
becomes not pending. It will miss to hold idev, but the rs_timer
is activated. Thus rs_timer callback function addrconf_rs_timer()
will be executed and put idev later without holding idev. A refcount
underflow issue for idev can be caused by this.
if (!timer_pending(&idev->rs_timer))
in6_dev_hold(idev);
<--------------[1]
mod_timer(&idev->rs_timer, jiffies + when);
To fix the issue, hold idev if mod_timer() return 0.
Fixes: b7b1bfce0bb6 ("ipv6: split duplicate address detection and router solicitation timer")
Suggested-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Ziyang Xuan <william.xuanziyang@huawei.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions