mirror of
https://github.com/RGBCube/serenity
synced 2026-01-15 00:11:00 +00:00
This commit adds minimal support for compiler-instrumentation based memory access sanitization. Currently we only support detection of kmalloc redzone accesses, and kmalloc use-after-free accesses. Support for inline checks (for improved performance), and for stack use-after-return and use-after-return detection is left for future PRs.
28 lines
728 B
C++
28 lines
728 B
C++
/*
|
|
* Copyright (c) 2023, Idan Horowitz <idan.horowitz@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/RefPtr.h>
|
|
#include <AK/Types.h>
|
|
#include <Kernel/FileSystem/SysFS/Subsystems/Kernel/Configuration/BooleanVariable.h>
|
|
#include <Kernel/Library/UserOrKernelBuffer.h>
|
|
|
|
namespace Kernel {
|
|
|
|
class SysFSKASANDeadly final : public SysFSSystemBooleanVariable {
|
|
public:
|
|
virtual StringView name() const override { return "kasan_is_deadly"sv; }
|
|
static NonnullRefPtr<SysFSKASANDeadly> must_create(SysFSDirectory const&);
|
|
|
|
private:
|
|
virtual bool value() const override;
|
|
virtual void set_value(bool new_value) override;
|
|
|
|
explicit SysFSKASANDeadly(SysFSDirectory const&);
|
|
};
|
|
|
|
}
|