]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ipmr: add debug check for mr table cleanup
authorPaolo Abeni <pabeni@redhat.com>
Sun, 24 Nov 2024 15:40:56 +0000 (16:40 +0100)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 28 Nov 2024 09:22:42 +0000 (10:22 +0100)
commit11b6e701bce96f98474084f26821157cb0dccf69
treeeaf234ab40c8d65eac08838dfa5a39323d9f6887
parent663a917475530feff868a4f2bda286ea4171f420
ipmr: add debug check for mr table cleanup

The multicast route tables lifecycle, for both ipv4 and ipv6, is
protected by RCU using the RTNL lock for write access. In many
places a table pointer escapes the RCU (or RTNL) protected critical
section, but such scenarios are actually safe because tables are
deleted only at namespace cleanup time or just after allocation, in
case of default rule creation failure.

Tables freed at namespace cleanup time are assured to be alive for the
whole netns lifetime; tables freed just after creation time are never
exposed to other possible users.

Ensure that the free conditions are respected in ip{,6}mr_free_table, to
document the locking schema and to prevent future possible introduction
of 'table del' operation from breaking it.

Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/ipv4/ipmr.c
net/ipv6/ip6mr.c