]> www.infradead.org Git - users/jedix/linux-maple.git/commit
l2tp: add idr consistency check in session_register
authorJames Chapman <jchapman@katalix.com>
Mon, 29 Jul 2024 15:38:12 +0000 (16:38 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 31 Jul 2024 08:25:13 +0000 (09:25 +0100)
commit0aa45570c3241e3bdba1a8b5b30d200c819b5b15
treedb23f65675c903124d1b935c7766b751b3c164e9
parent89b768ec2dfefaeba5212de14fc71368e12d06ba
l2tp: add idr consistency check in session_register

l2tp_session_register uses an idr_alloc then idr_replace pattern to
insert sessions into the session IDR. To catch invalid locking, add a
WARN_ON_ONCE if the IDR entry is modified by another thread between
alloc and replace steps.

Also add comments to make expectations clear.

Signed-off-by: James Chapman <jchapman@katalix.com>
Signed-off-by: Tom Parkin <tparkin@katalix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/l2tp/l2tp_core.c