]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
liveupdate: protect file handler list with rwsem
authorPasha Tatashin <pasha.tatashin@soleen.com>
Fri, 27 Mar 2026 03:33:27 +0000 (03:33 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Sat, 18 Apr 2026 07:10:49 +0000 (00:10 -0700)
commit9e1e18584548e8ef8b37a2a7f5eb84b91e35a160
treebe47c1442445bd86cb7e73d999245656fe5114ce
parent38fb71ace230bcf0106b6a09e7361c09255ba332
liveupdate: protect file handler list with rwsem

Because liveupdate file handlers will no longer hold a module reference
when registered, we must ensure that the access to the handler list is
protected against concurrent module unloading.

Utilize the global luo_register_rwlock to protect the global registry of
file handlers.  Read locks are taken during list traversals in
luo_preserve_file() and luo_file_deserialize().  Write locks are taken
during registration and unregistration.

Link: https://lore.kernel.org/20260327033335.696621-4-pasha.tatashin@soleen.com
Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Reviewed-by: Pratyush Yadav (Google) <pratyush@kernel.org>
Cc: David Matlack <dmatlack@google.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Samiullah Khawaja <skhawaja@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/liveupdate/luo_core.c
kernel/liveupdate/luo_file.c
kernel/liveupdate/luo_internal.h