Discussion:
[PATCH ghak80 V1] audit: add syscall information to FEATURE_CHANGE records
Add Reply
Richard Guy Briggs
2018-04-11 12:46:52 UTC
Reply
Permalink
Raw Message
Tie syscall information to FEATURE_CHANGE calls since it is a result of
user action.

See: https://github.com/linux-audit/audit-kernel/issues/80

Signed-off-by: Richard Guy Briggs <***@redhat.com>
---
kernel/audit.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/kernel/audit.c b/kernel/audit.c
index 8da24ef..23f125b 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -1103,10 +1103,9 @@ static void audit_log_feature_change(int which, u32 old_feature, u32 new_feature
{
struct audit_buffer *ab;

- if (audit_enabled == AUDIT_OFF)
+ if (!audit_enabled)
return;
-
- ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_FEATURE_CHANGE);
+ ab = audit_log_start(current->audit_context, GFP_KERNEL, AUDIT_FEATURE_CHANGE);
if (!ab)
return;
audit_log_task_info(ab, current);
--
1.8.3.1
Paul Moore
2018-04-17 22:06:24 UTC
Reply
Permalink
Raw Message
Post by Richard Guy Briggs
Tie syscall information to FEATURE_CHANGE calls since it is a result of
user action.
See: https://github.com/linux-audit/audit-kernel/issues/80
---
kernel/audit.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/kernel/audit.c b/kernel/audit.c
index 8da24ef..23f125b 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -1103,10 +1103,9 @@ static void audit_log_feature_change(int which, u32 old_feature, u32 new_feature
{
struct audit_buffer *ab;
- if (audit_enabled == AUDIT_OFF)
+ if (!audit_enabled)
Sooo, this is an unrelated style change, why? Looking at the rest of
kernel/audit.c we seem to use a mix of "(!x)" and "(x == 0/CONST)" so
why are you adding noise to this patch?
Post by Richard Guy Briggs
return;
-
- ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_FEATURE_CHANGE);
+ ab = audit_log_start(current->audit_context, GFP_KERNEL, AUDIT_FEATURE_CHANGE);
This is the important part, and the Right Thing To Do.
Post by Richard Guy Briggs
if (!ab)
return;
audit_log_task_info(ab, current);
--
1.8.3.1
--
paul moore
www.paul-moore.com
Steve Grubb
2018-04-17 22:10:30 UTC
Reply
Permalink
Raw Message
Post by Paul Moore
Post by Richard Guy Briggs
Tie syscall information to FEATURE_CHANGE calls since it is a result of
user action.
See: https://github.com/linux-audit/audit-kernel/issues/80
---
kernel/audit.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/kernel/audit.c b/kernel/audit.c
index 8da24ef..23f125b 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -1103,10 +1103,9 @@ static void audit_log_feature_change(int which,
u32 old_feature, u32 new_feature>
{
struct audit_buffer *ab;
- if (audit_enabled == AUDIT_OFF)
+ if (!audit_enabled)
Sooo, this is an unrelated style change, why? Looking at the rest of
kernel/audit.c we seem to use a mix of "(!x)" and "(x == 0/CONST)" so
why are you adding noise to this patch?
Post by Richard Guy Briggs
return;
-
- ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_FEATURE_CHANGE);
+ ab = audit_log_start(current->audit_context, GFP_KERNEL, AUDIT_FEATURE_CHANGE);
This is the important part, and the Right Thing To Do.
This is an unexpected change. I have asked questions on the github issue
tracker but have not gotten a satisfactory answer. Please do not merge this
until there's agreement on this.

Thanks,
-Steve
Post by Paul Moore
Post by Richard Guy Briggs
if (!ab)
return;
audit_log_task_info(ab, current);
--
1.8.3.1
Paul Moore
2018-04-18 02:01:46 UTC
Reply
Permalink
Raw Message
Post by Steve Grubb
Post by Paul Moore
Post by Richard Guy Briggs
Tie syscall information to FEATURE_CHANGE calls since it is a result of
user action.
See: https://github.com/linux-audit/audit-kernel/issues/80
---
kernel/audit.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/kernel/audit.c b/kernel/audit.c
index 8da24ef..23f125b 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -1103,10 +1103,9 @@ static void audit_log_feature_change(int which,
u32 old_feature, u32 new_feature>
{
struct audit_buffer *ab;
- if (audit_enabled == AUDIT_OFF)
+ if (!audit_enabled)
Sooo, this is an unrelated style change, why? Looking at the rest of
kernel/audit.c we seem to use a mix of "(!x)" and "(x == 0/CONST)" so
why are you adding noise to this patch?
Post by Richard Guy Briggs
return;
-
- ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_FEATURE_CHANGE);
+ ab = audit_log_start(current->audit_context, GFP_KERNEL,
AUDIT_FEATURE_CHANGE);
This is the important part, and the Right Thing To Do.
This is an unexpected change. I have asked questions on the github issue
tracker but have not gotten a satisfactory answer. Please do not merge this
until there's agreement on this.
It shouldn't be surprising, we've been talking about connecting
records for some time now, in different contexts and both on and off
list. Not only does it helps pave the way for the audit container ID
work, it just makes sense. I've seen your questions in this
particular GitHub issue and I think Richard has answered them
satisfactorily.

Once Richard removes the style change, or provides a good enough
reason for why it should stay in this patch, I plan on merging this
into audit/next.
--
paul moore
www.paul-moore.com
Loading...