tizen: mount /run/user/UID with noexec
authorKarol Lewandowski <k.lewandowsk@samsung.com>
Thu, 24 Mar 2022 16:03:56 +0000 (17:03 +0100)
committerŁukasz Stelmach <l.stelmach@samsung.com>
Mon, 25 Mar 2024 13:06:39 +0000 (14:06 +0100)
There is no point in having /run/user/UID mounted with exec, especially
that /run itself is mounted with noexec.

Change-Id: I16d46c3f3103205edf81764ca479ee0a569f90f7

src/login/user-runtime-dir.c

index afbbf12..4517105 100644 (file)
@@ -118,7 +118,7 @@ static int user_mkdir_runtime_path(
                 if (r < 0 && r != -EEXIST)
                         return log_error_errno(r, "Failed to create %s: %m", runtime_path);
 
-                r = mount_nofollow_verbose(LOG_DEBUG, "tmpfs", runtime_path, "tmpfs", MS_NODEV|MS_NOSUID, options);
+                r = mount_nofollow_verbose(LOG_DEBUG, "tmpfs", runtime_path, "tmpfs", MS_NODEV|MS_NOSUID|MS_NOEXEC, options);
                 if (r < 0) {
                         if (!ERRNO_IS_PRIVILEGE(r)) {
                                 log_error_errno(r, "Failed to mount per-user tmpfs directory %s: %m", runtime_path);