reactos/ntoskrnl
Timo Kreuzer d5181e44dd
[NTOS] Fix MiFindInitializationCode (#751)
Short: The code was suffering from an off-by-one bug (inconsistency between inclusive end exclusive end address), which could lead to freeing one page above the initialization code. This led to freeing part of the kernel import section on x64. Now it is consistently using the aligned/exclusive end address.

Long:
* Initialization sections are freed both for the boot loaded images as well as for drivers that are loaded later. Obviously the second mechanism needs to be able to run at any time, so it is not initialization code itself. For some reason someone decided though, it would be a smart idea to implement the code twice, once for the boot loaded images, once for drivers and concluding that the former was initialization code itself and had to be freed.
* Since freeing the code that frees the initialization sections, while it is doing that is not possible, it uses a "smart trick", initially skipping that range, returning its start and end to the caller and have the caller free it afterwards.
* The code was using the end address in an inconsistent way, partly aligning it to the start of the following section, sometimes pointing to the last byte that should be freed. The function that freed each chunk was assuming the latter (i.e. that the end was included in the range) and thus freed the page that contained the end address. The end address for the range that was returned to the caller was aligned to the start of the next section, and the caller used it to free the range including the following page. On x64 this was the start of the import section of ntoskrnl. How that worked on x86 I don't even want to know.
2018-08-21 10:35:57 +02:00
..
cache [NTOSKRNL] Drop the always running thread for lazy writer. 2018-02-07 21:37:17 +01:00
cc [NTOSKRNL] Be noisy when deferring writes. 2018-07-15 09:57:16 +02:00
config [REACTOS] Improve how some ASSERTMSG() message values are printed: enforce ending "\n". 2018-08-08 22:03:45 +02:00
dbgk [NTOS] Remove unnecessary NULL checks and add a missing one. CIDs 1411958, 716670, 1322186 2018-01-20 15:59:35 +01:00
ex [NTOS:EX] Implement SystemFirmwareTableInformation class 2018-08-19 20:27:59 +02:00
fsrtl [NTOSKRNL] Properly initialize the IO_STATUS_BLOCK 2018-08-17 19:13:13 +02:00
fstub [NTOS] Fix 64 bit warnings 2018-01-14 13:54:14 +01:00
inbv [NTOS:INBV] Simplify a little bit the BootLogoFadeIn() function 2018-01-03 02:57:28 +01:00
include [NTOS:OB] Rename object types to their official names to satisfy WinDbg 2018-08-17 20:28:45 +02:00
io [NTOSKRNL] Fix a nullptr dereference in IopStartDevice 2018-08-06 20:51:21 +02:00
kd [NTOSKRNL] Round memory size up, "debug log" part 2018-08-07 20:36:04 +02:00
kd64 [NTOSKRNL] Round memory size up, "debug log" part 2018-08-07 20:36:04 +02:00
kdbg [NTOSKRNL] Quickly implement the !defwrites in KDBG 2018-02-09 12:16:29 +01:00
ke [NDK] Fix the type of KPROCESS::ActiveProcessors 2018-07-01 14:45:21 +02:00
lpc [NTOS] Use KeClearEvent instead of KeResetEvent where the previous state is not needed. 2017-12-30 11:45:03 +01:00
mm [NTOS] Fix MiFindInitializationCode (#751) 2018-08-21 10:35:57 +02:00
ntkrnlmp
ob [NTOS:OB] Rename object types to their official names to satisfy WinDbg 2018-08-17 20:28:45 +02:00
po [NTOSKRNL] Dereference page file objects in MM shutdown phase 1 2018-08-13 08:30:17 +02:00
ps [NTOS:PS] Fix an issue with PROCESS_DEVICEMAP_INFORMATION size on 64 bit builds 2018-08-17 22:08:37 +02:00
rtl
se [NTOS:SE] Fix SeSetSecurityDescriptorInfoEx to prevent pool corruption on x64 2018-08-16 16:32:49 +02:00
tests
vdm
vf
wmi [REACTOS] Improve/Fix some "printf" formats (#555) 2018-05-30 14:18:23 +02:00
CMakeLists.txt
guid.c
KrnlFun.c
ntdll.S
ntos.cmake [NTOSKRNL] Stub MM shutdown 2018-08-13 08:30:17 +02:00
ntoskrnl.rc [NTOS:INBV] Implement rotation bar for boot screen 2018-01-03 02:57:28 +01:00
ntoskrnl.spec
sysfuncs.lst