reactos/ntoskrnl/config
George Bișoc fe23a4aaeb
[NTOS:CM] Lock the entire registry down when we unload a hive
The PR #6649 which fixed an issue with orphaned KCBs leaking in memory which also pointed to unloaded registry hives, it also brought a problem.
In CmpEnumerateOpenSubKeys there is a risk of getting hit by a deadlock as we enumerate the cache table to remove empty cache entries.

Fundamentally CmpEnumerateOpenSubKeys locks down a KCB from cache for exclusive use in order to tear down its contents from memory but it doesn't address the fact a KCB might have already been locked in the same calling thread, leading to a recursion.
This leads to random hangs when unloading a hive during system startup (tipically on a clean install).

The solution here is to simply lock the whole registry when we unload a hive so that we don't have to worry the KCBs are getting tampered by anybody else. This also simplifies the code.
Although locking the entire registry while other apps are doing registry related operations to other hives can cause overhead. If this turns out to be bad then we have to rethink the locking mechanism here.

CORE-19539
2024-06-01 16:17:47 +02:00
..
arm
i386
cmalloc.c
cmapi.c [NTOS:CM] Lock the entire registry down when we unload a hive 2024-06-01 16:17:47 +02:00
cmboot.c
cmconfig.c
cmcontrl.c [NTOS:CM][CMLIB] Minor code styling 2024-01-17 22:09:37 +01:00
cmdata.c [NTOS:CM][CMLIB] In PE mode, allow registry hives (except system ones) to use read/write access. 2024-01-17 22:13:03 +01:00
cmdelay.c
cmhook.c
cmhvlist.c
cminit.c [NTOS:CM][CMLIB] Minor code styling 2024-01-17 22:09:37 +01:00
cmkcbncb.c [NTOS:CM][CMLIB] Minor code styling 2024-01-17 22:09:37 +01:00
cmlazy.c [NTOS:CM][CMLIB] In PE mode, allow registry hives (except system ones) to use read/write access. 2024-01-17 22:13:03 +01:00
cmmapvw.c
cmnotify.c
cmparse.c [NTOS:CM][CMLIB] Minor code styling 2024-01-17 22:09:37 +01:00
cmquota.c
cmse.c [NTOS:CM][CMLIB] Minor code styling 2024-01-17 22:09:37 +01:00
cmsecach.c
cmsysini.c [NTOS:CM] Avoid unnecessary ObDereferenceObject when handling an ObInsertObject failure (#6673) 2024-03-30 22:10:17 +03:00
cmvalche.c [NTOS:CM][CMLIB] Minor code styling 2024-01-17 22:09:37 +01:00
cmwraprs.c
ntapi.c [NTOS:CM] Lock the entire registry down when we unload a hive 2024-06-01 16:17:47 +02:00