diff options
author | Cong Wang <xiyou.wangcong@gmail.com> | 2018-08-19 12:22:13 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-08-21 12:45:45 -0700 |
commit | 5ffe57da29b3802baeddaa40909682bbb4cb4d48 (patch) | |
tree | 445afddd040006b43d6d2ad85118b558ded5ca6c /fs/qnx6 | |
parent | 4e407ff5cd67ec76eeeea1deec227b7982dc7f66 (diff) |
act_ife: fix a potential deadlock
use_all_metadata() acquires read_lock(&ife_mod_lock), then calls
add_metainfo() which calls find_ife_oplist() which acquires the same
lock again. Deadlock!
Introduce __add_metainfo() which accepts struct tcf_meta_ops *ops
as an additional parameter and let its callers to decide how
to find it. For use_all_metadata(), it already has ops, no
need to find it again, just call __add_metainfo() directly.
And, as ife_mod_lock is only needed for find_ife_oplist(),
this means we can make non-atomic allocation for populate_metalist()
now.
Fixes: 817e9f2c5c26 ("act_ife: acquire ife_mod_lock before reading ifeoplist")
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'fs/qnx6')
0 files changed, 0 insertions, 0 deletions