mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
audit: use inline function to set audit context
Recognizing that the audit context is an internal audit value, use an access function to set the audit context pointer for the task rather than reaching directly into the task struct to set it. Signed-off-by: Richard Guy Briggs <rgb@redhat.com> [PM: merge fuzz in audit.h] Signed-off-by: Paul Moore <paul@paul-moore.com>
This commit is contained in:
parent
cdfb6b341f
commit
c0b0ae8a87
3 changed files with 11 additions and 5 deletions
|
@ -237,6 +237,11 @@ extern void audit_seccomp_actions_logged(const char *names,
|
|||
const char *old_names, int res);
|
||||
extern void __audit_ptrace(struct task_struct *t);
|
||||
|
||||
static inline void audit_set_context(struct task_struct *task, struct audit_context *ctx)
|
||||
{
|
||||
task->audit_context = ctx;
|
||||
}
|
||||
|
||||
static inline struct audit_context *audit_context(void)
|
||||
{
|
||||
return current->audit_context;
|
||||
|
@ -469,6 +474,8 @@ static inline bool audit_dummy_context(void)
|
|||
{
|
||||
return true;
|
||||
}
|
||||
static inline void audit_set_context(struct task_struct *task, struct audit_context *ctx)
|
||||
{ }
|
||||
static inline struct audit_context *audit_context(void)
|
||||
{
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue