On 9/9/22 05:56, Henry Wang wrote:
Hi Daniel,
-----Original Message-----
Subject: [PATCH] xsm/flask: adjust print messages to use %pd
Print messages from flask use an inconsistent format when printing the
domain
id. The %pd conversion specifier provides a consistent way to format for the
domain id and aligns with the rest of the hypervisor code.
Signed-off-by: Daniel P. Smith <dpsm...@apertussolutions.com>
---
xen/xsm/flask/avc.c | 8 ++++----
xen/xsm/flask/hooks.c | 3 +--
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/xen/xsm/flask/avc.c b/xen/xsm/flask/avc.c
index 4a75ec97e2..4a86681c81 100644
--- a/xen/xsm/flask/avc.c
+++ b/xen/xsm/flask/avc.c
@@ -566,14 +566,14 @@ void avc_audit(u32 ssid, u32 tsid, u16 tclass, u32
requested,
if ( a && (a->sdom || a->tdom) )
{
if ( a->sdom && a->tdom && a->sdom != a->tdom )
- avc_printk(&buf, "domid=%d target=%d ", a->sdom->domain_id, a-
tdom->domain_id);
+ avc_printk(&buf, "source=%pd target=%dp ", a->sdom, a->tdom);
I guess this should be target=%pd?
Erg! Turns out there is no conversion specifier validation occurring for
avc_printk(), thus the typo slipped through and not caught by the
compiler. I will fix and also add the printf annotation to avc_printk()
to help ensure conversion specifier and parameter types match.
With this fixed:
Reviewed-by: Henry Wang <henry.w...@arm.com>
Thanks!
This should also be fine to merge in 4.17, but following the discussion with
Julien and Jan I think providing a Release ack would lead to confusion...
I was hoping it would go in, but understand if it is kept out. I have a
list of clean-ups of varying sizes for XSM, with this one actually being
requested by someone else. I figured it was a simple one that could be
done quickly and might be worth trying to get it into the release.
v/r,
dps