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 [NTOS] "Bugzilla" --> "Jira" 2023-04-05 03:33:41 +02:00
cmalloc.c [NTOS:CM] Simplify CmpDelayAllocBucketLock code a bit (#5729) 2023-09-28 11:39:13 +02:00
cmapi.c [NTOS:CM] Lock the entire registry down when we unload a hive 2024-06-01 16:17:47 +02:00
cmboot.c [NTOS:CM] Adapt cmboot.c for usage in NT/ReactOS bootloader. 2022-04-16 18:37:45 +02:00
cmconfig.c [NTOS:CONFIG] Use correct "Interface" variable type; use InterfaceTypeUndefined instead of -1. 2023-06-25 21:25:06 +02:00
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 [FORMATTING][NTOS][HAL][DRIVERS][SDK] Fix trailing spaces 2021-06-11 15:33:08 +03:00
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 [FORMATTING][NTOS][HAL][DRIVERS][SDK] Fix trailing spaces 2021-06-11 15:33:08 +03:00
cmparse.c [NTOS:CM][CMLIB] Minor code styling 2024-01-17 22:09:37 +01:00
cmquota.c [FORMATTING][NTOS][HAL][DRIVERS][SDK] Fix trailing spaces 2021-06-11 15:33:08 +03:00
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 [NTOS:CM] Disable hard errors when setting up a new size for a hive file / annotate CmpFileSetSize parameters with SAL 2023-11-19 20:44:26 +01:00
ntapi.c [NTOS:CM] Lock the entire registry down when we unload a hive 2024-06-01 16:17:47 +02:00