* [PATCH] audit: no leading space in audit_log_d_path prefix
@ 2012-01-06 22:07 Kees Cook
2012-01-10 13:30 ` James Morris
0 siblings, 1 reply; 2+ messages in thread
From: Kees Cook @ 2012-01-06 22:07 UTC (permalink / raw)
To: linux-kernel; +Cc: Al Viro, Eric Paris, James Morris, linux-security-module
audit_log_d_path() injects an additional space before the prefix,
which serves no purpose and doesn't mix well with other audit_log*()
functions that do not sneak extra characters into the log.
Signed-off-by: Kees Cook <keescook@chromium.org>
---
kernel/audit.c | 2 +-
kernel/auditsc.c | 4 ++--
security/lsm_audit.c | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/kernel/audit.c b/kernel/audit.c
index 09fae26..9149149 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -1422,7 +1422,7 @@ void audit_log_d_path(struct audit_buffer *ab, const char *prefix,
char *p, *pathname;
if (prefix)
- audit_log_format(ab, " %s", prefix);
+ audit_log_format(ab, "%s", prefix);
/* We will allow 11 spaces for ' (deleted)' to be appended */
pathname = kmalloc(PATH_MAX+11, ab->gfp_mask);
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index 47b7fc1..c9b1af5 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -975,7 +975,7 @@ static void audit_log_task_info(struct audit_buffer *ab, struct task_struct *tsk
while (vma) {
if ((vma->vm_flags & VM_EXECUTABLE) &&
vma->vm_file) {
- audit_log_d_path(ab, "exe=",
+ audit_log_d_path(ab, " exe=",
&vma->vm_file->f_path);
break;
}
@@ -1489,7 +1489,7 @@ static void audit_log_exit(struct audit_context *context, struct task_struct *ts
case 0:
/* name was specified as a relative path and the
* directory component is the cwd */
- audit_log_d_path(ab, "name=", &context->pwd);
+ audit_log_d_path(ab, " name=", &context->pwd);
break;
default:
/* log the name's directory component */
diff --git a/security/lsm_audit.c b/security/lsm_audit.c
index 893af8a..db7bf14 100644
--- a/security/lsm_audit.c
+++ b/security/lsm_audit.c
@@ -231,7 +231,7 @@ static void dump_common_audit_data(struct audit_buffer *ab,
case LSM_AUDIT_DATA_PATH: {
struct inode *inode;
- audit_log_d_path(ab, "path=", &a->u.path);
+ audit_log_d_path(ab, " path=", &a->u.path);
inode = a->u.path.dentry->d_inode;
if (inode)
@@ -314,7 +314,7 @@ static void dump_common_audit_data(struct audit_buffer *ab,
.dentry = u->dentry,
.mnt = u->mnt
};
- audit_log_d_path(ab, "path=", &path);
+ audit_log_d_path(ab, " path=", &path);
break;
}
if (!u->addr)
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] audit: no leading space in audit_log_d_path prefix
2012-01-06 22:07 [PATCH] audit: no leading space in audit_log_d_path prefix Kees Cook
@ 2012-01-10 13:30 ` James Morris
0 siblings, 0 replies; 2+ messages in thread
From: James Morris @ 2012-01-10 13:30 UTC (permalink / raw)
To: Kees Cook; +Cc: linux-kernel, Al Viro, Eric Paris, linux-security-module
On Fri, 6 Jan 2012, Kees Cook wrote:
> audit_log_d_path() injects an additional space before the prefix,
> which serves no purpose and doesn't mix well with other audit_log*()
> functions that do not sneak extra characters into the log.
>
> Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: James Morris <jmorris@namei.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-01-10 13:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-06 22:07 [PATCH] audit: no leading space in audit_log_d_path prefix Kees Cook
2012-01-10 13:30 ` James Morris
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).