ip_set_type_list is traversed using list_for_each_entry_rcu outside an RCU read-side critical section but under the protection of ip_set_type_mutex. Hence, add corresponding lockdep expression to silence false-positive warnings, and harden RCU lists.
Unified · Split
| @@ -86,7 +86,8 @@ find_set_type(const char *name, u8 family, u8 revision) · 85 unmodified lines | ||
| 86 | 86 | { |
| 87 | 87 | struct ip_set_type *type; |
| 88 | 88 | |
| 89 | − list_for_each_entry_rcu(type, &ip_set_type_list, list) | |
| 89 | + list_for_each_entry_rcu(type, &ip_set_type_list, list, | |
| 90 | + lockdep_is_held(&ip_set_type_mutex)) | |
| 90 | 91 | if (STRNCMP(type->name, name) && |
| 91 | 92 | (type->family == family || |
| 92 | 93 | type->family == NFPROTO_UNSPEC) && |