[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH for-4.22? 5/9] domctl/XSM: avoid XSM_OTHER with xsm_domctl()


  • To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Date: Mon, 15 Jun 2026 16:57:54 -0400
  • Arc-authentication-results: i=1; mx.zohomail.com; dkim=pass header.i=apertussolutions.com; spf=pass smtp.mailfrom=dpsmith@xxxxxxxxxxxxxxxxxxxx; dmarc=pass header.from=<dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781557079; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=pq6G/TrdOTj3+AGR//pinKM6urItHglXx3EtWTrB7xM=; b=NyOnrPKdldeck2Rh202j9nJJTIC7T9mHyk7MrTr1O4Ps1MduUDgH3sLptkeZ/yKW7MWDUUSIcrX/p1fSCdyIXYZiPLs5FSG6ol9kx90QRssFcVE7JPtGVxr+W7fPIAyEScyU5S0Yf3ZcCOu2GgHRoTDLMmy2hrwgJNX/odyVPNE=
  • Arc-seal: i=1; a=rsa-sha256; t=1781557079; cv=none; d=zohomail.com; s=zohoarc; b=VJ4CRmWVuHyrtyj8pZ3zmsGueqWWh/WBW6EF4knnADJ0cDLbOTC3O+qX+pmujaYWAKdVmTbRshUcy9WFTdW27Et+6nIc1hq5dOIAUSEKAr8pLvXS4FDfEKOMwiKncEPGgyoiUjVLwczeQRRA7VpMUam2ibmKc5mLy+PICJD5/YI=
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=zoho header.d=apertussolutions.com header.i="dpsmith@xxxxxxxxxxxxxxxxxxxx" header.h="Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Content-Type:Content-Transfer-Encoding"
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
  • Delivery-date: Mon, 15 Jun 2026 20:58:22 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 6/15/26 10:13 AM, Jan Beulich wrote:
Make explicit at the call sites what (default) permission is required.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -331,7 +331,7 @@ long arch_do_domctl(
          /* Games to allow this code block to handle a compat guest. */
          void __user *guest_handle = domctl->u.getpageframeinfo3.array.p;
- ret = xsm_domctl(XSM_OTHER, d, domctl);
+        ret = xsm_domctl(XSM_PRIV, d, domctl);
          if ( ret )
              break;
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -743,7 +743,7 @@ long do_paging_domctl_cont(
      if ( d == NULL )
          return -ESRCH;
- ret = xsm_domctl(XSM_OTHER, d, &op);
+    ret = xsm_domctl(XSM_PRIV, d, &op);
      if ( !ret )
      {
          bool lock = !(op.u.shadow_op.op == XEN_DOMCTL_SHADOW_OP_CLEAN ||
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -516,7 +516,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
          if ( op->u.shadow_op.op == XEN_DOMCTL_SHADOW_OP_CLEAN ||
               op->u.shadow_op.op == XEN_DOMCTL_SHADOW_OP_PEEK )
          {
-            ret = xsm_domctl(XSM_OTHER, d, op);
+            ret = xsm_domctl(XSM_PRIV, d, op);
              if ( !ret )
                  ret = arch_do_domctl(op, d, u_domctl);
              goto domctl_out_unlock_rcuonly;
@@ -542,7 +542,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
          break;
      }
- ret = xsm_domctl(XSM_OTHER, d, op);
+    ret = xsm_domctl(XSM_PRIV, d, op);
      if ( ret )
          goto domctl_out_unlock_rcuonly;
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -157,7 +157,7 @@ static XSM_INLINE int cf_check xsm_set_t
  static XSM_INLINE int cf_check xsm_domctl(
      XSM_DEFAULT_ARG struct domain *d, struct xen_domctl *op)
  {
-    XSM_ASSERT_ACTION(XSM_OTHER);
+    XSM_ASSERT_ACTION(XSM_PRIV);
      switch ( op->cmd )
      {
      case XEN_DOMCTL_bind_pt_irq:
@@ -176,7 +176,7 @@ static XSM_INLINE int cf_check xsm_domct
          return -EILSEQ;
default:
-        return xsm_default_action(XSM_PRIV, current->domain, d);
+        return xsm_default_action(action, current->domain, d);
      }
  }

Acked-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.