diff options
| author | Sowmini Varadhan <sowmini.varadhan@oracle.com> | 2017-11-30 11:11:29 -0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-02-25 11:05:43 +0100 |
| commit | 4dc0159458d607c8ccf36ba91a262d7bba7d4bbc (patch) | |
| tree | d87c9bda40d25bc372e3e328a152a7c5f5c9daec /net/rds/tcp.h | |
| parent | 8d5c422fc709def69d574b03052c73bb6442a638 (diff) | |
rds: tcp: atomically purge entries from rds_tcp_conn_list during netns delete
commit f10b4cff98c6977668434fbf5dd58695eeca2897 upstream.
The rds_tcp_kill_sock() function parses the rds_tcp_conn_list
to find the rds_connection entries marked for deletion as part
of the netns deletion under the protection of the rds_tcp_conn_lock.
Since the rds_tcp_conn_list tracks rds_tcp_connections (which
have a 1:1 mapping with rds_conn_path), multiple tc entries in
the rds_tcp_conn_list will map to a single rds_connection, and will
be deleted as part of the rds_conn_destroy() operation that is
done outside the rds_tcp_conn_lock.
The rds_tcp_conn_list traversal done under the protection of
rds_tcp_conn_lock should not leave any doomed tc entries in
the list after the rds_tcp_conn_lock is released, else another
concurrently executiong netns delete (for a differnt netns) thread
may trip on these entries.
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/rds/tcp.h')
| -rw-r--r-- | net/rds/tcp.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/rds/tcp.h b/net/rds/tcp.h index 56ea6620fcf9..800e847d2e00 100644 --- a/net/rds/tcp.h +++ b/net/rds/tcp.h @@ -11,6 +11,7 @@ struct rds_tcp_incoming { struct rds_tcp_connection { struct list_head t_tcp_node; + bool t_tcp_node_detached; struct rds_conn_path *t_cpath; /* t_conn_path_lock synchronizes the connection establishment between * rds_tcp_accept_one and rds_tcp_conn_path_connect |
