Skip to contentSkip to conversation

audit: Fix possible return value truncation in audit_get_context()

RFC PATCH Applied Paul Moore 2 participants 2 messages Apr 1, 2009 Audit

lore
Share & tools
lore

Paul Moore

author
#0 lore raw

RFC PATCH 1/1 audit: Fix possible return value truncation in audit_get_context()

The audit subsystem treats syscall return codes as type long, unfortunately the audit_get_context() function mistakenly converts the return code to an int type in the parameters which could cause problems on systems where the sizeof(int) != sizeof(long).

---

 kernel/auditsc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/auditsc.c +1 -1
index 8cbddff..8d76dfc 100644
@@ -751,7 +751,7 @@ static void audit_set_auditable(struct audit_context *ctx)
 
 static inline struct audit_context *audit_get_context(struct task_struct *tsk,
 						      int return_valid,
-						      int return_code)
+						      long return_code)
 {
 	struct audit_context *context = tsk->audit_context;
 
#1 lore raw
Quoted 6 lines · Paul Moore

The audit subsystem treats syscall return codes as type long, unfortunately the audit_get_context() function mistakenly converts the return code to an int type in the parameters which could cause problems on systems where the sizeof(int) != sizeof(long).

Applied. E.g. for mmap() it's actually easy to trigger on 64bit boxen.