mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 20:32:04 +09:00
ANDROID: syscall_check: add vendor hook for open syscall
Through this vendor hook, we can get the timing to check
current running task for the validation of its credential
and open operation.
Bug: 191291287
Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Change-Id: Ia644ceb02dbc230ee1d25cad3630c2c3f908e41a
(cherry picked from commit a7a3b31d58)
This commit is contained in:
@@ -194,3 +194,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_module_permit_before_init);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_module_permit_after_init);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_selinux_is_initialized);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_check_mmap_file);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_check_file_open);
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include <linux/compat.h>
|
||||
|
||||
#include "internal.h"
|
||||
#include <trace/hooks/syscall_check.h>
|
||||
|
||||
int do_truncate(struct user_namespace *mnt_userns, struct dentry *dentry,
|
||||
loff_t length, unsigned int time_attrs, struct file *filp)
|
||||
@@ -805,6 +806,7 @@ static int do_dentry_open(struct file *f,
|
||||
error = -ENODEV;
|
||||
goto cleanup_all;
|
||||
}
|
||||
trace_android_vh_check_file_open(f);
|
||||
|
||||
error = security_file_open(f);
|
||||
if (error)
|
||||
|
||||
@@ -17,6 +17,10 @@ DECLARE_HOOK(android_vh_check_mmap_file,
|
||||
unsigned long flag, unsigned long ret),
|
||||
TP_ARGS(file, prot, flag, ret));
|
||||
|
||||
DECLARE_HOOK(android_vh_check_file_open,
|
||||
TP_PROTO(const struct file *file),
|
||||
TP_ARGS(file));
|
||||
|
||||
#endif /* _TRACE_HOOK_SYSCALL_CHECK_H */
|
||||
/* This part must be outside protection */
|
||||
#include <trace/define_trace.h>
|
||||
|
||||
Reference in New Issue
Block a user