apparmor: use SEND_SIG_NOINFO instead of NULL in aa_audit()
Subsystems (2)
PATCH 1/1 apparmor: use SEND_SIG_NOINFO instead of NULL in aa_audit()
SEND_SIG_NOINFO is defined as ((struct kernel_siginfo *) 0), so passing NULL works, but:
- this works "by accident" and looks as if the caller doesn't understand the signal sending API.
- more importantly, this hides the usage of SEND_SIG_NOINFO from grep, and this is really bad.
--- security/apparmor/audit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
security/apparmor/audit.c +1 -1
@@ -192,7 +192,7 @@ int aa_audit(int type, struct aa_profile *profile,aa_audit_msg (type, ad, cb);if (ad->type ==AUDIT_APPARMOR_KILL ) - (void )send_sig_info (profile->signal,NULL , +send_sig_info (profile->signal,SEND_SIG_NOINFO , ad->common.type ==LSM_AUDIT_DATA_TASK && ad->common.u.tsk ? ad->common.u.tsk : current);
Signature · 1 line
2.52.0
Quoted 8 lines
SEND_SIG_NOINFOis defined as ((structkernel_siginfo*) 0), so passing NULL works, but:- this works "by accident" and looks as if the caller doesn't understand the signal sending API.
- more importantly, this hides the usage of
SEND_SIG_NOINFOfrom grep, and this is really bad.
- also drop the now redundant (void)
Quoted 1 line
Quoted 20 lines
Signed-off-by Oleg Nesterov <[email protected]>--- security/apparmor/audit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)security/apparmor/audit.c +1
-1@@ -192,7 +192,7 @@ int aa_audit(int type, struct aa_profile *profile,aa_audit_msg (type, ad, cb);if (ad->type ==AUDIT_APPARMOR_KILL ) - (void )send_sig_info (profile->signal,NULL , +send_sig_info (profile->signal,SEND_SIG_NOINFO , ad->common.type ==LSM_AUDIT_DATA_TASK && ad->common.u.tsk ? ad->common.u.tsk : current);Signature · 1 line
2.52.0
Also, feel free to CC me in signal patches, so I can review, from you or from others.
Thanks!
Quoted 10 lines · Bradley Morgan
Quoted 9 lines
SEND_SIG_NOINFOis defined as ((structkernel_siginfo*) 0), so passing NULL works, but:- this works "by accident" and looks as if the caller doesn't understand the signal sending API.
- more importantly, this hides the usage of
SEND_SIG_NOINFOfrom grep, and this is really bad.- also drop the now redundant (void)
Yes, but the "void" cast was never necessary, I guess.
and just in case... To me the usage of SEND_SIG_NOINFO here doesn't look right with or without this change. Perhaps I am wrong, but please lets not discuss this right now, this connects to other cleanups I have in mind.
The purpose of this change is to make aa_audit() grep-friendly wrt SEND_SIG_NOINFO. And because send_sig_info(NULL) looks "just wrong" to me, no matter what.
Quoted 1 line
Reviewed-by Bradley Morgan <[email protected]>
Thanks,
Quoted 2 lines
Also, feel free to CC me in signal patches, so I can review, from you or from others.
OK, will do.
Oleg.
Quoted 22 lines · Oleg Nesterov
Quoted 2 lines · Bradley Morgan
Quoted 2 lines
SEND_SIG_NOINFOis defined as ((structkernel_siginfo*) 0), sopassing
Quoted 3 lines
Quoted 3 lines
NULL works, but:
- this works "by accident" and looks as if the caller doesn't
understand
Quoted 5 lines
Quoted 4 lines
the signal sending API.
- more importantly, this hides the usage of
SEND_SIG_NOINFOfrom grep, and this is really bad.- also drop the now redundant (void)
Yes, but the "void" cast was never necessary, I guess.
and just in case... To me the usage of
SEND_SIG_NOINFOhere doesn't look right with
or without this change. Perhaps I am wrong, but please lets not discuss this right
now, this connects to other cleanups I have in mind.
Quoted 3 lines
The purpose of this change is to make
aa_audit()grep-friendly wrtSEND_SIG_NOINFO.
And becausesend_sig_info(NULL)looks "just wrong" to me, no matter what.
No need, just a teeny tiny description nit.
Quoted 12 lines
Quoted 1 line
Reviewed-by Bradley Morgan <[email protected]>Thanks,
Quoted 2 lines
Also, feel free to CC me in signal patches, so I can review, from you or from others.
OK, will do.
Oleg.
Thanks!
Hi Oleg,
Quoted 9 lines · Oleg Nesterov
SEND_SIG_NOINFOis defined as ((structkernel_siginfo*) 0), so passing NULL works, but:- this works "by accident" and looks as if the caller doesn't understand the signal sending API.
- more importantly, this hides the usage of
SEND_SIG_NOINFOfrom grep, and this is really bad.
Quoted 18 lines
Signed-off-by Oleg Nesterov <[email protected]>--- security/apparmor/audit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)security/apparmor/audit.c +1
-1@@ -192,7 +192,7 @@ int aa_audit(int type, struct aa_profile *profile,aa_audit_msg (type, ad, cb);if (ad->type ==AUDIT_APPARMOR_KILL ) - (void )send_sig_info (profile->signal,NULL , +send_sig_info (profile->signal,SEND_SIG_NOINFO , ad->common.type ==LSM_AUDIT_DATA_TASK && ad->common.u.tsk ? ad->common.u.tsk : current);
Georgia Garcia
maintainerQuoted 10 lines · Oleg Nesterov
Quoted 9 lines · Bradley Morgan
Quoted 9 lines
SEND_SIG_NOINFOis defined as ((structkernel_siginfo*) 0), so passing NULL works, but:- this works "by accident" and looks as if the caller doesn't understand the signal sending API.
- more importantly, this hides the usage of
SEND_SIG_NOINFOfrom grep, and this is really bad.
Quoted 8 lines
Quoted 1 line
- also drop the now redundant (void)
Yes, but the "void" cast was never necessary, I guess.
and just in case... To me the usage of
SEND_SIG_NOINFOhere doesn't look right with or without this change. Perhaps I am wrong, but please lets not discuss this right now, this connects to other cleanups I have in mind.
Yes, I agree. Perhaps SEND_SIG_PRIV would be more appropriate here.
Quoted 14 lines
The purpose of this change is to make
aa_audit()grep-friendly wrtSEND_SIG_NOINFO. And becausesend_sig_info(NULL)looks "just wrong" to me, no matter what.Quoted 1 line
Reviewed-by Bradley Morgan <[email protected]>Thanks,
Quoted 2 lines
Also, feel free to CC me in signal patches, so I can review, from you or from others.
OK, will do.
Oleg.
Quoted 14 lines · Georgia Garcia
Quoted 12 lines · Oleg Nesterov
Quoted 10 lines · Bradley Morgan
Quoted 9 lines
SEND_SIG_NOINFOis defined as ((structkernel_siginfo*) 0), so passing NULL works, but:- this works "by accident" and looks as if the caller doesn't understand the signal sending API.
- more importantly, this hides the usage of
SEND_SIG_NOINFOfrom grep, and this is really bad.- also drop the now redundant (void)
Quoted 8 lines
Quoted 6 lines
Yes, but the "void" cast was never necessary, I guess.
and just in case... To me the usage of
SEND_SIG_NOINFOhere doesn't look right with or without this change. Perhaps I am wrong, but please lets not discuss this right now, this connects to other cleanups I have in mind.Yes, I agree. Perhaps
SEND_SIG_PRIVwould be more appropriate here.
Yes, this is what I meant. And I think the same is true for most of (all?) users of send_sig(sig, task, priv = 0), at least when task is current. I'll return to this later.
Thanks for your ACK!
Oleg.
Quoted 16 lines · Oleg Nesterov
Quoted 5 lines · Georgia Garcia
Quoted 3 lines · Oleg Nesterov
Quoted 2 lines · Bradley Morgan
Quoted 2 lines
SEND_SIG_NOINFOis defined as ((structkernel_siginfo*) 0), sopassing
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
NULL works, but:
- this works "by accident" and looks as if the caller doesn't
understand
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
the signal sending API.
- more importantly, this hides the usage of
SEND_SIG_NOINFOfromgrep,
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
and this is really bad.
Quoted 13 lines
Quoted 5 lines
Quoted 5 lines
Quoted 1 line
- also drop the now redundant (void)
Yes, but the "void" cast was never necessary, I guess.
and just in case... To me the usage of
SEND_SIG_NOINFOhere doesn'tlook right with
Quoted 1 line
Quoted 1 line
or without this change. Perhaps I am wrong, but please lets not
discuss this right
Quoted 4 lines
Quoted 2 lines
now, this connects to other cleanups I have in mind.
Yes, I agree. Perhaps
SEND_SIG_PRIVwould be more appropriate here.
Nice! thank you!
Quoted 9 lines
Yes, this is what I meant. And I think the same is true for most of (all?) users of
send_sig(sig, task, priv = 0), at least when task is current. I'll return to this later.Thanks for your ACK!
Oleg.
Thanks!
John Johansen
maintainerQuoted 10 lines · Oleg Nesterov
SEND_SIG_NOINFOis defined as ((structkernel_siginfo*) 0), so passing NULL works, but:- this works "by accident" and looks as if the caller doesn't understand the signal sending API.
- more importantly, this hides the usage of
SEND_SIG_NOINFOfrom grep, and this is really bad.Signed-off-by Oleg Nesterov <[email protected]>
this is now in apparmor-next
Quoted 17 lines
--- security/apparmor/audit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)security/apparmor/audit.c +1
-1@@ -192,7 +192,7 @@ int aa_audit(int type, struct aa_profile *profile,aa_audit_msg (type, ad, cb);if (ad->type ==AUDIT_APPARMOR_KILL ) - (void )send_sig_info (profile->signal,NULL , +send_sig_info (profile->signal,SEND_SIG_NOINFO , ad->common.type ==LSM_AUDIT_DATA_TASK && ad->common.u.tsk ? ad->common.u.tsk : current);