summaryrefslogtreecommitdiff
path: root/Kernel/Coredump.cpp
AgeCommit message (Collapse)Author
2022-09-20Kernel/x86: Move RTC and CMOS code to x86 arch-specific subdirectoryLiav A
The RTC and CMOS are currently only supported for x86 platforms and use specific x86 instructions to produce only certain x86 plaform operations and results, therefore, we move them to the Arch/x86 specific directory.
2022-08-31Kernel: Buffer an entire region when generating coredumpsTim Schumacher
This allows us to unlock the region tree lock early, to avoid keeping the lock while we are doing IO.
2022-08-31Kernel: Work using copies of specific region data during a coredumpTim Schumacher
This limits our interaction with the "real" region tree (and therefore its lock) to the time where we actually read from the user address space.
2022-08-24Kernel: Don't wrap AddressSpace's RegionTree in SpinlockProtectedAndreas Kling
Now that AddressSpace itself is always SpinlockProtected, we don't need to also wrap the RegionTree. Whoever has the AddressSpace locked is free to poke around its tree.
2022-08-24Kernel: Wrap process address spaces in SpinlockProtectedAndreas Kling
This forces anyone who wants to look into and/or manipulate an address space to lock it. And this replaces the previous, more flimsy, manual spinlock use. Note that pointers *into* the address space are not safe to use after you unlock the space. We've got many issues like this, and we'll have to track those down as wlel.
2022-08-24Kernel: Wrap RegionTree objects in SpinlockProtectedAndreas Kling
This makes locking them much more straightforward, and we can remove a bunch of confusing use of AddressSpace::m_lock. That lock will also be converted to use of SpinlockProtected in a subsequent patch.
2022-08-21Kernel: Make File::{chown,chmod} take credentials as inputAndreas Kling
...instead of getting them from Process::current(). :^)
2022-08-21Kernel: Make VirtualFileSystem functions take credentials as inputAndreas Kling
Instead of getting credentials from Process::current(), we now require that they be provided as input to the various VFS functions. This ensures that an atomic set of credentials is used throughout an entire VFS operation.
2022-08-21Kernel: Use credentials object in Coredump:try_create_target_fileJames Bellamy
2022-08-20Kernel: Make self-contained locking smart pointers their own classesAndreas Kling
Until now, our kernel has reimplemented a number of AK classes to provide automatic internal locking: - RefPtr - NonnullRefPtr - WeakPtr - Weakable This patch renames the Kernel classes so that they can coexist with the original AK classes: - RefPtr => LockRefPtr - NonnullRefPtr => NonnullLockRefPtr - WeakPtr => LockWeakPtr - Weakable => LockWeakable The goal here is to eventually get rid of the Lock* classes in favor of using external locking.
2022-08-18Kernel: Make Region's physical page accessors safer to useAndreas Kling
Region::physical_page() now takes the VMObject lock while accessing the physical pages array, and returns a RefPtr<PhysicalPage>. This ensures that the array access is safe. Region::physical_page_slot() now VERIFY()'s that the VMObject lock is held by the caller. Since we're returning a reference to the physical page slot in the VMObject's physical page array, this is the best we can do here.
2022-07-27Everywhere: Make the codebase more architecture awareUndefine
2022-04-03Kernel: Store AddressSpace memory regions in an IntrusiveRedBlackTreeAndreas Kling
This means we never need to allocate when inserting/removing regions from the address space.
2022-02-27Everywhere: Make JSON serialization fallibleIdan Horowitz
This allows us to eliminate a major source of infallible allocation in the Kernel, as well as lay down the groundwork for OOM fallibility in userland.
2022-02-11Kernel: Stop trying to write unmapped Process regions into CoreDumpsIdan Horowitz
If we crashed in the middle of mapping in Regions, some of the regions may not have a page directory yet, and will result in a crash when Region::remap() is called.
2022-01-12Kernel: Convert CoreDump to KString using try_serialize_absolute_pathIdan Horowitz
2021-12-30Kernel: Add some implied auto qualifiersHendiadyoin1
2021-12-22Kernel: Exclude PROT_NONE regions from coredumpsDaniel Bertalan
As PROT_NONE regions can't be accessed by processes, and their only real use is for reserving ranges of virtual memory, there's no point in including them in coredumps.
2021-11-21Kernel: Avoid repeated memory zeroing while generating coredumpsAndreas Kling
Reuse the same buffer-full-of-zeroes for every un-paged-in page that we dump out.
2021-11-21Kernel: Remove bogus TODO in coredump generationAndreas Kling
When dumping the memory contents of a process, we should not page in things from inodes that were not already paged in.
2021-11-21Kernel: Make UserOrKernelBuffer::for_user_buffer() return ErrorOr<T>Andreas Kling
This simplifies EFAULT propagation with TRY(). :^)
2021-11-08Kernel: Replace KResult and KResultOr<T> with Error and ErrorOr<T>Andreas Kling
We now use AK::Error and AK::ErrorOr<T> in both kernel and userspace! This was a slightly tedious refactoring that took a long time, so it's not unlikely that some bugs crept in. Nevertheless, it does pass basic functionality testing, and it's just real nice to finally see the same pattern in all contexts. :^)
2021-09-30Kernel: Exclude userspace heap memory from coredumps by defaultAndreas Kling
When a process with a large heap crashes (e.g WebContent), it gets very cumbersome to dump out a huge amount of memory. In the vast majority of cases, we're only interested in generating a nice backtrace from the coredump, so let's have the kernel skip over userspace heap regions when dumping memory for now. This is not ideal, and almost a little bit ugly, but it does make investigating 500 MiB WebContent crashes significantly easier for now.
2021-09-09Kernel: Use KString all the way in sys$execve()Andreas Kling
This patch converts all the usage of AK::String around sys$execve() to using KString instead, allowing us to catch and propagate OOM errors. It also required changing the kernel CommandLine helper class to return a vector of KString for the userspace init program arguments.
2021-09-07Kernel: Make it possible for KBufferBuilder creation to failAndreas Kling
This patch adds KBufferBuilder::try_create() and treats it like anything else that can fail. And so, failure to allocate the initial internal buffer of the builder will now propagate an ENOMEM to the caller. :^)
2021-09-07Kernel: Rename FileDescription => OpenFileDescriptionAndreas Kling
Dr. POSIX really calls these "open file description", not just "file description", so let's call them exactly that. :^)
2021-09-06Kernel: Don't allocate so much when generating coredumpsAndreas Kling
Instead of creating a bunch of ByteBuffers and concatenating them to generate the "notes" segment, we now simply create a KBufferBuilder and tell each of the notes generator helpers to write into the builder. This allows the code to flow more naturally, with some bonus additional error propagation. :^)
2021-09-06Kernel: Tidy up Coredump constructionAndreas Kling
- Use KResultOr and TRY to propagate errors - Return more specific errors now that they have a path out from here
2021-09-06Kernel: Use TRY() in CoredumpAndreas Kling
2021-09-06Kernel: Rename ProcessPagingScope => ScopedAddressSpaceSwitcherAndreas Kling
2021-09-06Everywhere: Use OOM-safe ByteBuffer APIs where possibleAli Mohammad Pur
If we can easily communicate failure, let's avoid asserting and report failure instead.
2021-08-23Everywhere: Core dump => CoredumpAndreas Kling
We all know what a coredump is, and it feels more natural to refer to it as a coredump (most code already does), so let's be consistent.