All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sandeep Patil <sspatil@google.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] mknod03: Skip S_ISGID check on files created by non-group members.
Date: Fri,  3 Aug 2018 08:22:25 -0700	[thread overview]
Message-ID: <20180803152225.21107-1-sspatil@google.com> (raw)

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.

Signed-off-by: Sandeep Patil <sspatil@google.com>
---
 testcases/kernel/syscalls/mknod/mknod03.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/testcases/kernel/syscalls/mknod/mknod03.c b/testcases/kernel/syscalls/mknod/mknod03.c
index 2af66f78c..7ecadb5b3 100644
--- a/testcases/kernel/syscalls/mknod/mknod03.c
+++ b/testcases/kernel/syscalls/mknod/mknod03.c
@@ -142,14 +142,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) {
-- 
2.18.0.597.ga71716f1ad-goog


             reply	other threads:[~2018-08-03 15:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-03 15:22 Sandeep Patil [this message]
2018-08-03 15:32 ` [LTP] [PATCH] mknod03: Skip S_ISGID check on files created by non-group members Jan Stancek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180803152225.21107-1-sspatil@google.com \
    --to=sspatil@google.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.