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
This commit is contained in:
@@ -348,3 +348,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rproc_recovery);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ptype_head);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_kfree_skb);
|
||||
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 dentry *dentry, loff_t length, unsigned int time_attrs,
|
||||
struct file *filp)
|
||||
@@ -800,6 +801,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