lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240727-tomoyo-gen-file-v1-1-eb6439e837a1@suse.com>
Date: Sat, 27 Jul 2024 21:51:40 -0300
From: Marcos Paulo de Souza <mpdesouza@...e.com>
To: Kentaro Takeda <takedakn@...data.co.jp>, 
 Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>, 
 Paul Moore <paul@...l-moore.com>, James Morris <jmorris@...ei.org>, 
 "Serge E. Hallyn" <serge@...lyn.com>, Nathan Chancellor <nathan@...nel.org>, 
 Nick Desaulniers <ndesaulniers@...gle.com>, 
 Bill Wendling <morbo@...gle.com>, Justin Stitt <justinstitt@...gle.com>
Cc: linux-kernel@...r.kernel.org, linux-security-module@...r.kernel.org, 
 llvm@...ts.linux.dev, Marcos Paulo de Souza <mpdesouza@...e.com>
Subject: [PATCH RFC] security: tomoyo: Add default builtin-policy.h for
 default policy

When checking tomoyo code there is an include for a file that is not
included on kernel-source since it's generated at build time, and the
kernel-source uses git archive to create the tarball.

Having the source code referencing a file that is not included in the
tarball can confuse tools that inspect/parse code, since the file is not
there.

The builtin-policy.h added is generated from the same default policy
that already exists on policy/ directory, so it doesn't break the
current usage of that file.

Signed-off-by: Marcos Paulo de Souza <mpdesouza@...e.com>
---
Hello, I sent this patch because we saw some issues while running
clang-extract[1] on tomoyo given CVE 2024-26622. Since clang-extract
parses the C files it failed to find builtin-policy.h. As a bandaid, I
had to add
	-DCONFIG_SECURITY_TOMOYO_INSECURE_BUILTIN_SETTING

to clang-extract (we feed the gcc arguments used to compile common.c got
from compile_commands.json on kernel-source).

Per my tests it works with my patch, and I don't see why this would hurt
to have builtin-policy.h on git, since it would regenerate the file if
the policy scripts are changed.

Please let me know if I'm missing something here.

Thanks!

[1]: https://github.com/SUSE/clang-extract
---
 security/tomoyo/.gitignore       |  1 -
 security/tomoyo/builtin-policy.h | 13 +++++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/security/tomoyo/.gitignore b/security/tomoyo/.gitignore
index 9f300cdce362..85d086c6502d 100644
--- a/security/tomoyo/.gitignore
+++ b/security/tomoyo/.gitignore
@@ -1,3 +1,2 @@
 # SPDX-License-Identifier: GPL-2.0-only
-builtin-policy.h
 policy/*.conf
diff --git a/security/tomoyo/builtin-policy.h b/security/tomoyo/builtin-policy.h
new file mode 100644
index 000000000000..781d35b3ccb3
--- /dev/null
+++ b/security/tomoyo/builtin-policy.h
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+static char tomoyo_builtin_profile[] __initdata =
+	"";
+static char tomoyo_builtin_exception_policy[] __initdata =
+	"initialize_domain /sbin/modprobe from any\n"
+	"initialize_domain /sbin/hotplug from any\n"
+	"";
+static char tomoyo_builtin_domain_policy[] __initdata =
+	"";
+static char tomoyo_builtin_manager[] __initdata =
+	"";
+static char tomoyo_builtin_stat[] __initdata =
+	"";

---
base-commit: 910bfc26d16d07df5a2bfcbc63f0aa9d1397e2ef
change-id: 20240727-tomoyo-gen-file-fcfc3a0c0f46

Best regards,
-- 
Marcos Paulo de Souza <mpdesouza@...e.com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ