aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSandeep Patil <sspatil@google.com>2018-08-03 08:13:22 -0700
committerSteve Muckle <smuckle@google.com>2018-10-19 09:29:32 -0700
commitad83a1f850fa3cf482570ab2994f37a35991d44a (patch)
tree1ab6e0d07b2c62578a5076c7a518a99c5b71f720
parent188ab43f46aa3c88d679f3286e3beb9bab8130e1 (diff)
downloadltp-oreo-vts-dev.tar.gz
mknod03: Skip S_ISGID check on files created by non-group members.oreo-vts-dev
0fa3ecd87848 ("Fix up non-directory creation in SGID directories") fixes problem described in CVE-2018-13405. This commit is backported to older streams as well. This patch removes S_ISGID check for files created by non-group members in LTP tests mknod03. Basically, does the same thing as commit '3c87ef2961' for mknod03 test. Bug: 112110312 Bug: 117638424 Test: run vts-kernel -m VtsKernelLtp -t syscalls.mknod03 Change-Id: I453c57af273379c24a0a2b8587ddc3b93ebc5e47 Merged-In: I453c57af273379c24a0a2b8587ddc3b93ebc5e47 Signed-off-by: Sandeep Patil <sspatil@google.com> (cherry picked from commit 54dbc7044990a3a2048a5908112e6432f4102c0c)
-rw-r--r--testcases/kernel/syscalls/mknod/mknod03.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/testcases/kernel/syscalls/mknod/mknod03.c b/testcases/kernel/syscalls/mknod/mknod03.c
index 4318bb9b6..e7d15060c 100644
--- a/testcases/kernel/syscalls/mknod/mknod03.c
+++ b/testcases/kernel/syscalls/mknod/mknod03.c
@@ -141,14 +141,11 @@ int main(int ac, char **av)
fflag = 0;
}
- /* Verify mode permissions of node */
- if (!(buf.st_mode & S_ISGID)) {
- tst_resm(TFAIL,
- "%s: Incorrect modes, setgid bit not "
- "set", node_name);
- /* unset flag as functionality fails */
- fflag = 0;
- }
+ /*
+ * Skip S_ISGID check
+ * 0fa3ecd87848 ("Fix up non-directory creation in SGID directories")
+ * clears S_ISGID for files created by non-group members
+ */
/* Verify group ID */
if (buf.st_gid != group2_gid) {