From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>, jandryuk@gmail.com
Subject: [PATCH] xsm/flask: adjust print messages to use %pd
Date: Fri, 9 Sep 2022 05:50:12 -0400 [thread overview]
Message-ID: <20220909095012.4251-1-dpsmith@apertussolutions.com> (raw)
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 <dpsmith@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);
else if ( a->sdom )
- avc_printk(&buf, "domid=%d ", a->sdom->domain_id);
+ avc_printk(&buf, "source=%pd ", a->sdom);
else
- avc_printk(&buf, "target=%d ", a->tdom->domain_id);
+ avc_printk(&buf, "target=%pd ", a->tdom);
}
else if ( cdom )
- avc_printk(&buf, "domid=%d ", cdom->domain_id);
+ avc_printk(&buf, "current=%pd ", cdom);
switch ( a ? a->type : 0 ) {
case AVC_AUDIT_DATA_DEV:
avc_printk(&buf, "device=%#lx ", a->device);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 8bd56644ef..a79281bdb0 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -281,8 +281,7 @@ static int cf_check flask_evtchn_interdomain(
rc = security_transition_sid(sid1, sid2, SECCLASS_EVENT, &newsid);
if ( rc )
{
- printk("security_transition_sid failed, rc=%d, Dom%d\n",
- -rc, d2->domain_id);
+ printk("security_transition_sid failed, rc=%d, %pd\n", -rc, d2);
return rc;
}
--
2.20.1
next reply other threads:[~2022-09-09 9:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-09 9:50 Daniel P. Smith [this message]
2022-09-09 9:56 ` [PATCH] xsm/flask: adjust print messages to use %pd Henry Wang
2022-09-09 11:52 ` Daniel P. Smith
2022-09-09 12:45 ` Henry Wang
2022-09-09 10:04 ` Jan Beulich
2022-09-09 11:34 ` Daniel P. Smith
2022-09-09 12:10 ` Jan Beulich
2022-09-09 15:41 ` Daniel P. Smith
2022-09-12 6:35 ` Jan Beulich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220909095012.4251-1-dpsmith@apertussolutions.com \
--to=dpsmith@apertussolutions.com \
--cc=jandryuk@gmail.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.