diff options
author | Thomas Graf <tgraf@suug.ch> | 2014-08-07 01:18:47 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-08-07 04:17:44 +0200 |
commit | 6c8f7e70837468da4e658080d4448930fb597e1b (patch) | |
tree | b16af5d1fcabe792f0b565d9fca2686cad480efd /net/netlink/af_netlink.h | |
parent | tcp: md5: check md5 signature without socket lock (diff) | |
download | linux-6c8f7e70837468da4e658080d4448930fb597e1b.tar.xz linux-6c8f7e70837468da4e658080d4448930fb597e1b.zip |
netlink: hold nl_sock_hash_lock during diag dump
Although RCU protection would be possible during diag dump, doing
so allows for concurrent table mutations which can render the
in-table offset between individual Netlink messages invalid and
thus cause legitimate sockets to be skipped in the dump.
Since the diag dump is relatively low volume and consistency is
more important than performance, the table mutex is held during
dump.
Reported-by: Andrey Wagin <avagin@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Fixes: e341694e3eb57fc ("netlink: Convert netlink_lookup() to use RCU protected hash table")
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netlink/af_netlink.h')
-rw-r--r-- | net/netlink/af_netlink.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/netlink/af_netlink.h b/net/netlink/af_netlink.h index 60f631fb7087..b20a1731759b 100644 --- a/net/netlink/af_netlink.h +++ b/net/netlink/af_netlink.h @@ -73,5 +73,6 @@ struct netlink_table { extern struct netlink_table *nl_table; extern rwlock_t nl_table_lock; +extern struct mutex nl_sk_hash_lock; #endif |