diff mbox series

[v4,12/14] Implement configuration and methods for default model.

Message ID 20240826103728.3378-13-greg@enjellic.com (mailing list archive)
State New
Delegated to: Paul Moore
Headers show
Series Implement Trusted Security Event Modeling. | expand

Commit Message

Dr. Greg Aug. 26, 2024, 10:37 a.m. UTC
The implementation of a TSEM model consists of three separate
components:

- bypasses array

- event initialization method

- event coefficient mapping method.

Boolean true values in the bypasses array is used to indicate
that the event should be completely bypassed.

The event initialization initializes the event description
structure using the characteristics of the event.

The event coefficient mapping method is responsible for
generating the security event coefficient from the event
description structure.

The model0.c file provides the model components for the default
deterministic model implemented by the kernel.
---
 security/tsem/model0.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 security/tsem/model0.c
diff mbox series

Patch

diff --git a/security/tsem/model0.c b/security/tsem/model0.c
new file mode 100644
index 000000000000..347ed8584842
--- /dev/null
+++ b/security/tsem/model0.c
@@ -0,0 +1,21 @@ 
+// SPDX-License-Identifier: GPL-2.0-only
+
+/*
+ * Copyright (C) 2024 Enjellic Systems Development, LLC
+ * Author: Dr. Greg Wettstein <greg@enjellic.com>
+ *
+ * This file contains methods and definitions for the 'model0'
+ * security model implementation.  This is the default model that
+ * TSEM implements.
+ */
+
+#include "tsem.h"
+
+static bool event_bypasses[TSEM_EVENT_CNT];
+
+const struct tsem_context_ops tsem_model0_ops = {
+	.name = "model0",
+	.bypasses = event_bypasses,
+	.init = tsem_event_generate,
+	.map = tsem_map_event
+};