Skip site navigation (1)Skip section navigation (2)


index | | raw e-mail

I have a local patch that addresses this, at least partially. I don't know 
if there are other places that also need attention in the tree. Nor is this 
anywhere near ready for commit but it should get you going for now.

Maybe someone else can clean it up and commit it.




--==_Exmh_1766000677_84540
Content-Type: application/x-patch ; name="0001-CSES-Finish-VMM-commit.patch"
Content-Description: 0001-CSES-Finish-VMM-commit.patch
Content-Transfer-Encoding: quoted-printable

>From 730eede73b453b775a1ce323e454c2b10db25b62 Mon Sep 17 00:00:00 2001
From: Cy Schubert <cy@FreeBSD.org>
Date: Wed, 17 Dec 2025 09:56:33 -0800
Subject: [PATCH 1/2] CSES: Finish VMM commit

Fixes:	1092ec8b3375
---
 bin/sh/miscbltin.c        |  3 +++
 lib/libutil/login.conf.5  |  1 +
 lib/libutil/login_class.3 |  1 +
 lib/libutil/login_class.c |  1 +
 usr.bin/limits/limits.1   |  3 +++
 usr.bin/limits/limits.c   | 14 +++++++++++---
 6 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/bin/sh/miscbltin.c b/bin/sh/miscbltin.c
index bbf0aa5b8bde..60417a09d86c 100644
--- a/bin/sh/miscbltin.c
+++ b/bin/sh/miscbltin.c
@@ -517,6 +517,9 @@ static const struct limits limits[] =3D {
 #endif
 #ifdef RLIMIT_PIPEBUF
 	{ "pipebuf",		(char *)0,	RLIMIT_PIPEBUF, 1024, 'y' },
+#endif
+#ifdef RLIMIT_VMM
+	{ "vmm",		(char *)0,	RLIMIT_VMM, 1024, 'y' },
 #endif
 	{ (char *) 0,		(char *)0,	0,		   0, '\0' }
 };
diff --git a/lib/libutil/login.conf.5 b/lib/libutil/login.conf.5
index 942f3ecd2661..b78e279100e4 100644
--- a/lib/libutil/login.conf.5
+++ b/lib/libutil/login.conf.5
@@ -205,6 +205,7 @@ login environment.
 .It "swapuse	size		Maximum swap space size limit."
 .It "umtxp	number		Maximum number of process-shared pthread locks."
 .It "pipebuf	size		Maximum size of pipe buffers."
+.It "vmm	size		Maximum number of virtual machines."
 .El
 .Pp
 These resource limit entries actually specify both the maximum
diff --git a/lib/libutil/login_class.3 b/lib/libutil/login_class.3
index 46e6a70f8ca8..86fb6507eb67 100644
--- a/lib/libutil/login_class.3
+++ b/lib/libutil/login_class.3
@@ -119,6 +119,7 @@ swapuse          RLIMIT_SWAP
 kqueues          RLIMIT_KQUEUES
 umtxp            RLIMIT_UMTXP
 pipebuf          RLIMIT_PIPEBUF
+vmm              RLIMIT_VMM
 .Ed
 .It LOGIN_SETPRIORITY
 Set the scheduling priority for the current process based on the
diff --git a/lib/libutil/login_class.c b/lib/libutil/login_class.c
index 9478b4dc98ca..04ee26c45e46 100644
--- a/lib/libutil/login_class.c
+++ b/lib/libutil/login_class.c
@@ -66,6 +66,7 @@ static struct login_res {
     { "kqueues",         login_getcapsize, RLIMIT_KQUEUES },
     { "umtxp",           login_getcapnum,  RLIMIT_UMTXP   },
     { "pipebuf",         login_getcapnum,  RLIMIT_PIPEBUF },
+    { "vmm",             login_getcapnum,  RLIMIT_VMM },
     { NULL,              0,                0              }
 };
 =

diff --git a/usr.bin/limits/limits.1 b/usr.bin/limits/limits.1
index 0e374acd991b..e56fabf508b9 100644
--- a/usr.bin/limits/limits.1
+++ b/usr.bin/limits/limits.1
@@ -284,6 +284,9 @@ resource limit.
 Select or set the
 .Va pipebuf
 resource limit.
+Select or set the
+.Va vmm
+resource limit.
 .El
 .Pp
 Valid values for
diff --git a/usr.bin/limits/limits.c b/usr.bin/limits/limits.c
index c53066b52a9f..c6d3493cddc1 100644
--- a/usr.bin/limits/limits.c
+++ b/usr.bin/limits/limits.c
@@ -92,6 +92,7 @@ static struct {
 	  { "  kqueues%-4s          %8s", "\n",       1    },
 	  { "  umtxp%-4s            %8s", "\n",       1    },
 	  { "  pipebuf%-4s          %8s", " kB\n",    1024 },
+	  { "  vmm%-4s              %8s", " \n",      1    }
       }
     },
     { "sh", "unlimited", "", " -H", " -S", "",
@@ -112,6 +113,7 @@ static struct {
 	  { "ulimit%s -k %s", ";\n",  1    },
 	  { "ulimit%s -o %s", ";\n",  1    },
 	  { "ulimit%s -y %s", ";\n",  1024 },
+	  { "ulimit%s -v %s", ";\n",  1    }
       }
     },
     { "csh", "unlimited", "", " -h", "", NULL,
@@ -131,6 +133,7 @@ static struct {
 	  { "limit%s swapsize %s",        ";\n",  1024 },
 	  { "limit%s kqueues %s",         ";\n",  1    },
 	  { "limit%s umtxp %s",           ";\n",  1    },
+	  { "limit%s vmm %s",             ";\n",  1    }
       }
     },
     { "bash|bash2", "unlimited", "", " -H", " -S", "",
@@ -147,7 +150,8 @@ static struct {
 	  { "ulimit%s -b %s", ";\n",  1    },
 	  { "ulimit%s -v %s", ";\n",  1024 },
 	  { "ulimit%s -p %s", ";\n",  1    },
-	  { "ulimit%s -w %s", ";\n",  1024 }
+	  { "ulimit%s -w %s", ";\n",  1024 },
+	  { "ulimit%s -v %s", ";\n",  1    }
       }
     },
     { "tcsh", "unlimited", "", " -h", "", NULL,
@@ -167,6 +171,7 @@ static struct {
 	  { "limit%s swapsize %s",        ";\n",  1024 },
 	  { "limit%s kqueues %s",         ";\n",  1    },
 	  { "limit%s umtxp %s",           ";\n",  1    },
+	  { "limit%s vmm %s",             ";\n",  1    }
       }
     },
     { "ksh|pdksh", "unlimited", "", " -H", " -S", "",
@@ -183,7 +188,8 @@ static struct {
 	  { "ulimit%s -b %s", ";\n",  1    },
 	  { "ulimit%s -v %s", ";\n",  1024 },
 	  { "ulimit%s -p %s", ";\n",  1    },
-	  { "ulimit%s -w %s", ";\n",  1024 }
+	  { "ulimit%s -w %s", ";\n",  1024 },
+	  { "ulimit%s -v %s", ";\n",  1    }
       }
     },
     { "zsh", "unlimited", "", " -H", " -S", "",
@@ -200,7 +206,8 @@ static struct {
 	  { "ulimit%s -b %s", ";\n",  1    },
 	  { "ulimit%s -v %s", ";\n",  1024 },
 	  { "ulimit%s -p %s", ";\n",  1    },
-	  { "ulimit%s -w %s", ";\n",  1024 }
+	  { "ulimit%s -w %s", ";\n",  1024 },
+	  { "ulimit%s -v %s", ";\n",  1    }
       }
     },
     { "rc|es", "unlimited", "", " -h", "", NULL,
@@ -245,6 +252,7 @@ static struct {
     { "kqueues",	login_getcapnum  },
     { "umtxp",		login_getcapnum  },
     { "pipebuf",	login_getcapnum  },
+    { "vmm",		login_getcapnum  },
 };
 =

 /*
-- =

2.52.0

--==_Exmh_1766000677_84540
Content-Type: text/plain; charset=us-ascii

Cheers,
Cy Schubert <Cy.Schubert@cschubert.com>
FreeBSD UNIX:  <cy@FreeBSD.org>   Web:  https://FreeBSD.org
NTP:           <cy@nwtime.org>    Web:  https://nwtime.org

			e**(i*pi)+1=0

--==_Exmh_1766000677_84540--




help