mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-13 03:29:49 +00:00
Kernel: Implement 'copy_time_from_user' functions to sanitize arguments
This commit is contained in:
parent
bd6be910e5
commit
649abc01bc
Notes:
sideshowbarker
2024-07-18 21:48:14 +09:00
Author: https://github.com/BenWiederhake
Commit: 649abc01bc
Pull-request: https://github.com/SerenityOS/serenity/pull/5323
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/bgianfo
2 changed files with 32 additions and 0 deletions
|
@ -28,7 +28,9 @@
|
|||
|
||||
#include <AK/Checked.h>
|
||||
#include <AK/Forward.h>
|
||||
#include <AK/Time.h>
|
||||
#include <AK/Userspace.h>
|
||||
#include <Kernel/UnixTypes.h>
|
||||
|
||||
namespace Syscall {
|
||||
struct StringArgument;
|
||||
|
@ -36,6 +38,10 @@ struct StringArgument;
|
|||
|
||||
[[nodiscard]] String copy_string_from_user(const char*, size_t);
|
||||
[[nodiscard]] String copy_string_from_user(Userspace<const char*>, size_t);
|
||||
[[nodiscard]] Optional<Time> copy_time_from_user(const timespec*);
|
||||
[[nodiscard]] Optional<Time> copy_time_from_user(const timeval*);
|
||||
template<typename T>
|
||||
[[nodiscard]] Optional<Time> copy_time_from_user(Userspace<T*> src);
|
||||
|
||||
[[nodiscard]] Optional<u32> user_atomic_fetch_add_relaxed(volatile u32* var, u32 val);
|
||||
[[nodiscard]] Optional<u32> user_atomic_exchange_relaxed(volatile u32* var, u32 val);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue