[RFC PATCH v1 2/7] audit: Fix inode numbers

Mickaël Salaün
2024-10-10T15:34:37Z

Use the new inode_get_ino() helper to log the user space's view of
inode's numbers instead of the private kernel values.

Cc: Paul Moore <paul@paul-moore.com>
Cc: Eric Paris <eparis@redhat.com>
Signed-off-by: Mickaël Salaün <mic@digikod.net>
---
security/lsm_audit.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/security/lsm_audit.c b/security/lsm_audit.c
index 849e832719e2..c39a22b27cce 100644
--- a/security/lsm_audit.c
+++ b/security/lsm_audit.c
@@ -227,7 +227,7 @@ static void dump_common_audit_data(struct audit_buffer *ab,
if (inode) {
audit_log_format(ab, " dev=");
audit_log_untrustedstring(ab, inode->i_sb->s_id);
- audit_log_format(ab, " ino=%lu", inode->i_ino);
+ audit_log_format(ab, " ino=%llu", inode_get_ino(inode));
}
break;
}
@@ -240,7 +240,7 @@ static void dump_common_audit_data(struct audit_buffer *ab,
if (inode) {
audit_log_format(ab, " dev=");
audit_log_untrustedstring(ab, inode->i_sb->s_id);
- audit_log_format(ab, " ino=%lu", inode->i_ino);
+ audit_log_format(ab, " ino=%llu", inode_get_ino(inode));
}
break;
}
@@ -253,7 +253,7 @@ static void dump_common_audit_data(struct audit_buffer *ab,
if (inode) {
audit_log_format(ab, " dev=");
audit_log_untrustedstring(ab, inode->i_sb->s_id);
- audit_log_format(ab, " ino=%lu", inode->i_ino);
+ audit_log_format(ab, " ino=%llu", inode_get_ino(inode));
}

audit_log_format(ab, " ioctlcmd=0x%hx", a->u.op->cmd);
@@ -271,7 +271,7 @@ static void dump_common_audit_data(struct audit_buffer *ab,
if (inode) {
audit_log_format(ab, " dev=");
audit_log_untrustedstring(ab, inode->i_sb->s_id);
- audit_log_format(ab, " ino=%lu", inode->i_ino);
+ audit_log_format(ab, " ino=%llu", inode_get_ino(inode));
}
break;
}
@@ -290,7 +290,7 @@ static void dump_common_audit_data(struct audit_buffer *ab,
}
audit_log_format(ab, " dev=");
audit_log_untrustedstring(ab, inode->i_sb->s_id);
- audit_log_format(ab, " ino=%lu", inode->i_ino);
+ audit_log_format(ab, " ino=%llu", inode_get_ino(inode));
rcu_read_unlock();
break;
}
--
2.46.1