From patchwork Fri Aug 3 15:22:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sandeep Patil X-Patchwork-Id: 143415 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp289444ljj; Fri, 3 Aug 2018 08:22:36 -0700 (PDT) X-Google-Smtp-Source: AAOMgpejwu592DP7FnOQH836+GESESWELMGQe5bK1YY0jvBoVuBV2anJ6Fpnrch8JCcMraPx2jta X-Received: by 2002:adf:a634:: with SMTP id k49-v6mr2983967wrc.181.1533309756481; Fri, 03 Aug 2018 08:22:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533309756; cv=none; d=google.com; s=arc-20160816; b=reqAkbosK/j/SunnpFDAApncHyK7XNKBxgzSFNP9LE7crHjogJzho3lFXSCJoQGPfn vUyCF5efFcNRh7k+ghv1JY3oQOJRdJUg7K6jQGDdkkj4ZXTDqKDosKQREgyOQPTtg3ek T20ViPR5zMiiERYgZieh5TGIQddmIpfZojFSBL9+GVb7ZjjsEWdJgV4lQYMFGZo9Ybsv /VG5HtuO6oq3i454qF+7ogUcH4NrdVEoje7yGGPAx7R6dZV3DNI9AwwgLuyo8jeX+fqo KyTE4XC5G75mGJ+U7Fm+VIf2qSHvgjYWDAbCzTT0dro9VZ6lLHeqMPEPW5Pul1jFI601 LiBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:message-id:date:to:from:dkim-signature:delivered-to :arc-authentication-results; bh=d2Zc2vwcwKHwj//VZW0R8tcaPsWZDd6BvvVnZRN5DPI=; b=XTo6f40bibCvTyc40/vfzS2ChkwPd3elAOACavSuVwdWqDJTFgZQY9HtOyz0DygoCz FNQFlloXKly2deGO59MwX1MOjuzHlxezKOy4gSWJ+KqlMt2EO8RaKF5xZF2MtG2niRp6 fkF97SXCcKFgG+wftIPFPl3fIBFRpKUMe6nMw2OQ/MVcvW9lCoWBzSCaCm+Wzv3FcLRV kglsJJ13/oao16xVgPV4uppNuzRGJAgMwStEeKK5qmdHA67WcslfL0E3MtdcbAoD3sVM 5pFjU0Pc4atEFf/1ziqC2sKWtP4qQJw1Z98VM0ebE6k4Ity8kceS7Pbm2DdH8LI2hZad Q27A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@google.com header.s=20161025 header.b=otvXyE2S; spf=pass (google.com: domain of ltp-bounces+patch=linaro.org@lists.linux.it designates 213.254.12.146 as permitted sender) smtp.mailfrom="ltp-bounces+patch=linaro.org@lists.linux.it"; dmarc=fail (p=REJECT sp=REJECT dis=QUARANTINE) header.from=google.com Return-Path: Received: from picard.linux.it (picard.linux.it. [213.254.12.146]) by mx.google.com with ESMTPS id r202-v6si3758374wmd.199.2018.08.03.08.22.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Aug 2018 08:22:36 -0700 (PDT) Received-SPF: pass (google.com: domain of ltp-bounces+patch=linaro.org@lists.linux.it designates 213.254.12.146 as permitted sender) client-ip=213.254.12.146; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@google.com header.s=20161025 header.b=otvXyE2S; spf=pass (google.com: domain of ltp-bounces+patch=linaro.org@lists.linux.it designates 213.254.12.146 as permitted sender) smtp.mailfrom="ltp-bounces+patch=linaro.org@lists.linux.it"; dmarc=fail (p=REJECT sp=REJECT dis=QUARANTINE) header.from=google.com Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id F37F63E6716 for ; Fri, 3 Aug 2018 17:22:35 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-3.smtp.seeweb.it (in-3.smtp.seeweb.it [217.194.8.3]) by picard.linux.it (Postfix) with ESMTP id BF9793E6677 for ; Fri, 3 Aug 2018 17:22:32 +0200 (CEST) Received: from mail-pl0-x243.google.com (mail-pl0-x243.google.com [IPv6:2607:f8b0:400e:c01::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by in-3.smtp.seeweb.it (Postfix) with ESMTPS id 0FCF51A0115A for ; Fri, 3 Aug 2018 17:22:32 +0200 (CEST) Received: by mail-pl0-x243.google.com with SMTP id j8-v6so2681186pll.12 for ; Fri, 03 Aug 2018 08:22:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=2R+X1jye2FHKC66vGWbYvVLR7/IDpsKttFWWZBJCQFY=; b=otvXyE2SeLW3WlLc5+1e7lmljrbfaoEDpdXE3ynhpiA8j3gyzI6ZcyGVqZKo/1Sa8/ +zWGmR4Y2oTwRf/BuJoulGIxqjiYm5JGOXG5r3iVbqXRUN1Kqqip/QCznh1wEokqRk+x rGzQrCBHyfU3xsmH3/N86llLn9RZM3JIDrAFNtKleLUQO/jFReYpvvgO12yY1Ore6JGP i0m3cXLvlv34bDLjPEGGSsOYqwdgE/CCf29Ky2fVA6wk5u9L4cMuktG0ei1dW2V6nhwV 4VBwplM2Gl2xGv3kZDRD/coAdprVd1Z3D1ozV0EcMMGRdxgPQK8uaCNrSBF/g5PNs18k iDzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=2R+X1jye2FHKC66vGWbYvVLR7/IDpsKttFWWZBJCQFY=; b=HQjg9PqXPV5Y8M/qHZtlNY9aBmZQtTBa4b5g+FZT52PpdIUdrk6HiHsju8zvuYlqoH 6ZhP2IZd5Ts5qAaR2lwITblI3um+2P07ndhf9w0AMdTxpc8Q0To2+fKqzr+GJNC9tZHo nQjTi0BpknVsjKj9Sj+BbrNpVV7hBf50JiY+w+FqDGxZx0Kh2VLEUhTTojDlMERgpbo3 FDkKC+U3/GyxTvrIeRdVQUSSLngWqu6wSv34nM6FHTw/UQr9bKlYsjR3CsGw9vnOH+u/ 6Whc7VBUqn5yEYKREIHwhh22BjxbO5bm234RpJRRSY49PLve95xWnZhY2RezAiyflyyl jvEw== X-Gm-Message-State: AOUpUlH7B/POUpEhkrg3sgGz06rR+oOpLcCMYOdnLeJWy42ZdwYHtU4T /PfvrLRKsVs6XOFigIjD4C/X6XTxYj8CQA== X-Received: by 2002:a17:902:ab94:: with SMTP id f20-v6mr3986625plr.231.1533309749956; Fri, 03 Aug 2018 08:22:29 -0700 (PDT) Received: from sspatil-desktop.mtv.corp.google.com ([2620:0:1000:1600:6e29:33f4:7c9a:4918]) by smtp.gmail.com with ESMTPSA id y20-v6sm5052998pgv.31.2018.08.03.08.22.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Aug 2018 08:22:28 -0700 (PDT) From: Sandeep Patil To: ltp@lists.linux.it Date: Fri, 3 Aug 2018 08:22:25 -0700 Message-Id: <20180803152225.21107-1-sspatil@google.com> X-Mailer: git-send-email 2.18.0.597.ga71716f1ad-goog MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.99.2 at in-3.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=-14.9 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,ENV_AND_HDR_SPF_MATCH,SPF_PASS,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-3.smtp.seeweb.it Cc: chrubis@suze.cz, kernel-team@android.com Subject: [LTP] [PATCH] mknod03: Skip S_ISGID check on files created by non-group members. X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+patch=linaro.org@lists.linux.it Sender: "ltp" 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 --- 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) {