[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [PATCH] xsm/flask: adjust print messages to use %pd
- To: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Henry Wang <Henry.Wang@xxxxxxx>
- Date: Fri, 9 Sep 2022 09:56:21 +0000
- Accept-language: zh-CN, en-US
- Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XMVI0uwjXlNqgN//YaBP0fYehbV3VaJJVKqOggi+tNE=; b=d1NXrlhsNnn3IauyKZp42sb2t8J4sMvZGl+xTa9Zb/I/LnZ02z+UpDNclFFO0IJVT1KtRkB95O3t8GhSotqDNromWfigKv67at1Y3bcqYr1EXJ+VfVoLnYnK6/nv63s2EHqg4vZVDgPlFFpKMBSbeaTLQjbxstTgiookyryLzgZd8F6ccYbJ5bQc2bKckbr5mUOXsibeq8hJ2nALEPwnX0LCma8wzCWhyIJhB/gmXkcemJN8KxJn4aISt44mIeVxEeJfqlu65+P+EI+MmRHWcat5IqJfa2Wd/pmMrHY0Lggj24++K5Rjz/y2VLXJ4QmChPL4Y//FC9OujC3NyMFqbQ==
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XMVI0uwjXlNqgN//YaBP0fYehbV3VaJJVKqOggi+tNE=; b=WW7XbDSGwRdlOX4AUKKB1MZyrG+4wSbWzVVfi+4Ui+7ZrDtq6jK8UBpwTBF/GtQAfuho8lz2C3xvC9YGxjVTghjPZK6XKokyUmVeQ1XS8WQqaemhxLc2UlxlSsYUMj6++4Uf2h3iXX17DM9yrVFZedhwJQuDLyjlFaPmaYfPC9LO5IVXBgyVvgXM1w7EghuD5Mp6eU22iVW4wOh2mkG2XJmEtkOQr5/VvZIJVw45DXtlk6xX+Yy1ui7pgmH5T5+LwEFYitGfTk9NiipLeGZ4COL1HdSgYWA3Bs6kw9i00zw2o0s8UhlTGA3ccJmt41ElucTnpjenbD4Y8sMqfUr2RA==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=K149ofrXjXDqMEHawZDsbixjhZNd4X8ZvQHQ5Wf8cCwKwTWOSnDcZhOzx8mCtGpj4AA97ik9uPy6ompXxi/lN2UOSAkgK2bqEzEnr/F2K4cvybwCoM8KExtDAgbXTzUnwZSX2C0klXLSpteQgBmPNdzzRzmNWLekQwLV3SzWIczPxVFwIO/jG/itE3n14vFODR6Rv088WNJ2mgqm4FRpQsRvgbuLWjuXZ74nrWQNwGoSpi36SAn9wyNv6uQ34PLBdm5m/kKbymgt5E9xRnG7yMMyO+707fwdXkk34Xf/Mz5w90WzKUrhAH5hL3Yuf+SsNtwURe/a55s657sViNIMBg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y5X5gXDb6OidzYtLnfEC5x1rDjUdghG/MDemU0imvGFSeauy0nMiYycP7AZiDHGjvC1Z5JWpYDlGNl70R5UyA2mX4uw5pY9Fw4NhrYJawMbSM1vqkrXwu0xm6WGZN9c8Y/NSZH7IA3aCXsv338fkiKKulnwJWt6BrZWGVPmzv4KdWV52PuPG9lb1BY8AR7xYOY0mGCeuunVHjR2iLpwgdT0YRCWU5nF2YRrUHOQsbqmMHPBt2V0sNK9LiuRiXEeOYrhNvBSD4IXtN9s8wDk5KRrwKZP0QVWx1v0FzR3QHtaDpznIXV3luA390tLMqSZck1tzPp8U7myO/2Wg+aob0g==
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: "jandryuk@xxxxxxxxx" <jandryuk@xxxxxxxxx>
- Delivery-date: Fri, 09 Sep 2022 09:56:42 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
- Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Thread-index: AQHYxDGm1l2kl9jZnEi0PeM8zmcB0K3W20Yg
- Thread-topic: [PATCH] xsm/flask: adjust print messages to use %pd
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 <dpsmith@xxxxxxxxxxxxxxxxxxxx>
> ---
> 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?
With this fixed:
Reviewed-by: Henry Wang <Henry.Wang@xxxxxxx>
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...
Kind regards,
Henry
> 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
>
|