lsm_audit: avoid overloading the "key" audit field
PATCH 1/1 lsm_audit: avoid overloading the "key" audit field
The "key" field is used to associate records with the rule that triggered them, os it's not a good idea to overload it with an additional IPC key semantic. Moreover, as the classic "key" field is a text field, while the IPC key is numeric, AVC records containing the IPC key info actually confuse audit userspace, which tries to interpret the number as a hex-encoded string, thus showing garbage for example in the ausearch "interpret" output mode.
Hence, change it to "ipc_key" to fix both issues and also make the meaning of this field more clear.
--- security/lsm_audit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
security/lsm_audit.c +1 -1
@@ -224,7 +224,7 @@ static void dump_common_audit_data(struct audit_buffer *ab,case LSM_AUDIT_DATA_NONE :return ;case LSM_AUDIT_DATA_IPC : -audit_log_format (ab," key=%d " , a->u.ipc_id); +audit_log_format (ab," ipc_key=%d " , a->u.ipc_id);break ;case LSM_AUDIT_DATA_CAP :audit_log_format (ab," capability=%d " , a->u.cap);
Signature · 1 line
2.31.1
Paul Moore
maintainerQuoted 9 lines · Ondrej Mosnacek
The "key" field is used to associate records with the rule that triggered them, os it's not a good idea to overload it with an additional IPC key semantic. Moreover, as the classic "key" field is a text field, while the IPC key is numeric, AVC records containing the IPC key info actually confuse audit userspace, which tries to interpret the number as a hex-encoded string, thus showing garbage for example in the ausearch "interpret" output mode.
Quoted 7 lines
Hence, change it to "
ipc_key" to fix both issues and also make the meaning of this field more clear.Signed-off-by Ondrej Mosnacek <[email protected]>--- security/lsm_audit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Seems reasonable to me, I can merge it via the audit/next tree unless James would prefer to take it via the LSM tree.
Quoted 15 lines
security/lsm_audit.c +1
-2@@ -224,7 +224,7 @@ static void dump_common_audit_data(struct audit_buffer *ab,case LSM_AUDIT_DATA_NONE :return ;case LSM_AUDIT_DATA_IPC : -audit_log_format (ab," key=%d " , a->u.ipc_id); +audit_log_format (ab," ipc_key=%d " , a->u.ipc_id);break ;case LSM_AUDIT_DATA_CAP :audit_log_format (ab," capability=%d " , a->u.cap); --2.31.1
Signature · 2 lines
paul moore www.paul-moore.com
Paul Moore
maintainerQuoted 14 lines · Paul Moore
Quoted 12 lines · Ondrej Mosnacek
The "key" field is used to associate records with the rule that triggered them, os it's not a good idea to overload it with an additional IPC key semantic. Moreover, as the classic "key" field is a text field, while the IPC key is numeric, AVC records containing the IPC key info actually confuse audit userspace, which tries to interpret the number as a hex-encoded string, thus showing garbage for example in the ausearch "interpret" output mode.
Hence, change it to "
ipc_key" to fix both issues and also make the meaning of this field more clear.
Quoted 7 lines
Quoted 4 lines
Signed-off-by Ondrej Mosnacek <[email protected]>--- security/lsm_audit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Seems reasonable to me, I can merge it via the audit/next tree unless James would prefer to take it via the LSM tree.
As this is pretty minor and unlikely to conflict with any LSMs, I've gone ahead and merged this into the audit/next tree.
Signature · 2 lines
paul moore www.paul-moore.com
Quoted 10 lines · Ondrej Mosnacek
The "key" field is used to associate records with the rule that triggered them, os it's not a good idea to overload it with an additional IPC key semantic. Moreover, as the classic "key" field is a text field, while the IPC key is numeric, AVC records containing the IPC key info actually confuse audit userspace, which tries to interpret the number as a hex-encoded string, thus showing garbage for example in the ausearch "interpret" output mode.
Hence, change it to "
ipc_key" to fix both issues and also make the meaning of this field more clear.
Good call.
Quoted 1 line
Signed-off-by Ondrej Mosnacek <[email protected]>
Quoted 20 lines
--- security/lsm_audit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)security/lsm_audit.c +1
-1@@ -224,7 +224,7 @@ static void dump_common_audit_data(struct audit_buffer *ab,case LSM_AUDIT_DATA_NONE :return ;case LSM_AUDIT_DATA_IPC : -audit_log_format (ab," key=%d " , a->u.ipc_id); +audit_log_format (ab," ipc_key=%d " , a->u.ipc_id);break ;case LSM_AUDIT_DATA_CAP :audit_log_format (ab," capability=%d " , a->u.cap);Signature · 1 line
2.31.1
- RGB
--
Richard Guy Briggs <[email protected]>
Sr. S/W Engineer, Kernel Security, Base Operating Systems Remote, Ottawa, Red Hat Canada
IRC: rgb, SunRaycer
Voice: +1.647.777.2635, Internal: (81) 32635