diff options
author | Zhang Changzhong <zhangchangzhong@huawei.com> | 2023-09-15 19:20:41 +0800 |
---|---|---|
committer | Steffen Klassert <steffen.klassert@secunet.com> | 2023-09-20 13:03:59 +0200 |
commit | cc9b364bb1d58d3dae270c7a931a8cc717dc2b3b (patch) | |
tree | ccebe938507b2b4f1312c85f1ab5589e7c0798ec /arch/m68k/Kconfig.bus | |
parent | 3e4bc23926b83c3c67e5f61ae8571602754131a6 (diff) | |
download | linux-stable-cc9b364bb1d58d3dae270c7a931a8cc717dc2b3b.tar.gz linux-stable-cc9b364bb1d58d3dae270c7a931a8cc717dc2b3b.tar.bz2 linux-stable-cc9b364bb1d58d3dae270c7a931a8cc717dc2b3b.zip |
xfrm6: fix inet6_dev refcount underflow problem
There are race conditions that may lead to inet6_dev refcount underflow
in xfrm6_dst_destroy() and rt6_uncached_list_flush_dev().
One of the refcount underflow bugs is shown below:
(cpu 1) | (cpu 2)
xfrm6_dst_destroy() |
... |
in6_dev_put() |
| rt6_uncached_list_flush_dev()
... | ...
| in6_dev_put()
rt6_uncached_list_del() | ...
... |
xfrm6_dst_destroy() calls rt6_uncached_list_del() after in6_dev_put(),
so rt6_uncached_list_flush_dev() has a chance to call in6_dev_put()
again for the same inet6_dev.
Fix it by moving in6_dev_put() after rt6_uncached_list_del() in
xfrm6_dst_destroy().
Fixes: 510c321b5571 ("xfrm: reuse uncached_list to track xdsts")
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
Reviewed-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'arch/m68k/Kconfig.bus')
0 files changed, 0 insertions, 0 deletions