From patchwork Wed Feb 21 07:16:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Gao X-Patchwork-Id: 1901856 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=lists.linux.it header.i=@lists.linux.it header.a=rsa-sha256 header.s=picard header.b=GfCpOdm6; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=google header.b=X1iUE34h; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=patchwork.ozlabs.org) Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Tfnf80x8yz23cl for ; Wed, 21 Feb 2024 18:17:19 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.linux.it; i=@lists.linux.it; q=dns/txt; s=picard; t=1708499833; h=to : date : message-id : in-reply-to : references : mime-version : subject : list-id : list-unsubscribe : list-archive : list-post : list-help : list-subscribe : from : reply-to : content-type : content-transfer-encoding : sender : from; bh=3X9RQ7gzEGZzgrhVnKW01AxWoWpc6EUDMhOpfPrq8Lc=; b=GfCpOdm6M7mCeHNx49sIH0VshGly5VlPeB0TMwLrCOBLQsNm9bL0OiunXAdY61b0wckg2 JGrZSUEqKh2SlM9K3aCQWwDVt7jDiimaf0svGuzjnq+Mf9KVdIxYZ3nJNBKbB8HB5XhGxg7 CdYRlXdgXK6C6FsEL2pFYv6wLgJcppA= Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 299903CD90E for ; Wed, 21 Feb 2024 08:17:13 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it [217.194.8.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id F1B253CF1AE for ; Wed, 21 Feb 2024 08:16:58 +0100 (CET) Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by in-4.smtp.seeweb.it (Postfix) with ESMTPS id 5F41D1000C1A for ; Wed, 21 Feb 2024 08:16:58 +0100 (CET) Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2d23a5a7c18so33925541fa.2 for ; Tue, 20 Feb 2024 23:16:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1708499817; x=1709104617; darn=lists.linux.it; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=naAs/dYVQmevTSvDz+3o+NE2Si9Z7LzarOSpYcBqiGQ=; b=X1iUE34h+5TsGn266qAWC6Dy/an/EoMHXAhpcQ/Xsi7xz1pj6FiVwzjHASUW0XDQTb +0tppVQ++LZtd0pH+Uk2E4v0x7mlaLGVnhdmdsj7ETZehNM/AvcWWQZaPMl8PLlNFIU6 J4gtPS7b9Z4diX3nl2S8AmzsJHdr0Wx3Bq+nLSXuO6Hq2f4eQ4pM4S0C6XnIR0IS6JPY yhS0KxTr+pTNsdg1FAu6JkAecSBQBS4g9sFEqpPuc5dgBnwLq1cbQEMfYFHTx3TTGrNW d/SPE/Mo5+JDc30pWhSPDcKiyCkk4Hi/kszHO7d3AlISo6tYn+K81fNAdUlg/p3/vJAd FVZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708499817; x=1709104617; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=naAs/dYVQmevTSvDz+3o+NE2Si9Z7LzarOSpYcBqiGQ=; b=aEhtOR2fKTJxIHmS75kKyF0/s0X9kHidp2M8G6lHupk965uY8wItV6CIRc3H91PkWt JJNHZx61PjVHYprUAtmq1aHzqaDBOHWyecOpVpCllyrS+M2igsgWtstoVl40dYS7Fc2j yVuMiIH+W7nALFyp+OYHRkpDY0LcpbjiWPdhg8gGCFOJKYCVTiLHF9EQaVNWWiAlTGT0 KNp3jEvpg2oy+C3kH/6ZAXNr8jCmz9KIlVGAyJb2gNvPnhZLRNKEMIGQig4B4XHhL/4Q Y8GS3pmdKjL3EJzqSn+CeFm6KzzrWTmS32Ppj/GWL4t8xVFk1fkwwETb3UF0iGD7gnyN ZmEA== X-Gm-Message-State: AOJu0YzAHn7EW+ekCXBt//vLPgKaL0gzwRTsrh6o32niU/Ts9ox4E9MG gzUEvfht6y7U5NN3Y1lYXp/4ZKxZli+6+u0la1emfIydtZruiJ2gblTwcn5IKsLJXS9Yo3WjKsE = X-Google-Smtp-Source: AGHT+IEy8mU4eLkEnNQJljuNYAiZ9z8/lLD7jOTGMMtw2h7Ad2XEctYtIOlJGfP6Q6gZswVqr2YuPw== X-Received: by 2002:a2e:a4b8:0:b0:2d2:3d31:220f with SMTP id g24-20020a2ea4b8000000b002d23d31220fmr3840784ljm.25.1708499817121; Tue, 20 Feb 2024 23:16:57 -0800 (PST) Received: from localhost ([223.72.38.233]) by smtp.gmail.com with ESMTPSA id q13-20020a056a00088d00b006e05c801748sm8046037pfj.199.2024.02.20.23.16.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 23:16:56 -0800 (PST) To: ltp@lists.linux.it Date: Wed, 21 Feb 2024 02:16:34 -0500 Message-Id: <20240221071635.17239-2-wegao@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240221071635.17239-1-wegao@suse.com> References: <20240219134845.22171-1-wegao@suse.com> <20240221071635.17239-1-wegao@suse.com> MIME-Version: 1.0 X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=disabled version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on in-4.smtp.seeweb.it X-Virus-Scanned: clamav-milter 1.0.3 at in-4.smtp.seeweb.it X-Virus-Status: Clean Subject: [LTP] [PATCH v3 1/2] cgroup_core01.c: Set system default umaks to 0022 X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Wei Gao via ltp From: Wei Gao Reply-To: Wei Gao Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" When system's default umask is 0077, this will trigger issues for LTP case. cgroup_core01.c will report following error msg: cgroup_core01.c:50: TBROK: openat(21, 'tasks', 2, 0): EACCES (13) Detail reason: Code: cg_child_a = tst_cg_group_mk(tst_cg, "child_a"); cg_child_b = tst_cg_group_mk(tst_cg, "child_b"); Result: wegao:/sys/fs/cgroup # ll ltp/test-25304/ drwx------ 2 root root 0 Feb 10 10:37 child_a <<<<<< group and other has no any permission drwx------ 2 root root 0 Feb 10 10:38 child_b Code: SAFE_CG_FCHOWN(cg_child_a, "cgroup.procs", nobody_uid, -1); SAFE_CG_FCHOWN(cg_child_b, "cgroup.procs", nobody_uid, -1); Result: wegao:/sys/fs/cgroup # ll ltp/test-26388/child_a/ total 0 -rw-r--r-- 1 nobody root 0 Feb 10 10:44 cgroup.procs <<<<<< Code: SAFE_SETEUID(nobody_uid); <<<< after switch to nobody then can not access child_{a,b} or any file under child_{a,b} Result: nobody@wegao:/sys/fs/cgroup/ltp/test-26730> ll child_a/ <<< nobody has no permission on child_a ls: cannot open directory 'child_a/': Permission denied Code: loops = SAFE_CG_OPEN(cg_child_b, "cgroup.procs", O_RDWR, fds); Result: cgroup_core01.c:76: TBROK: openat(9, 'cgroup.procs', 2, 0): EACCES (13) Signed-off-by: Wei Gao --- testcases/kernel/controllers/cgroup/cgroup_core01.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/testcases/kernel/controllers/cgroup/cgroup_core01.c b/testcases/kernel/controllers/cgroup/cgroup_core01.c index 2e695deed..80d13a9c5 100644 --- a/testcases/kernel/controllers/cgroup/cgroup_core01.c +++ b/testcases/kernel/controllers/cgroup/cgroup_core01.c @@ -76,6 +76,8 @@ static void setup(void) { struct passwd *pw; + umask(0022); + pw = SAFE_GETPWNAM("nobody"); nobody_uid = pw->pw_uid; save_uid = geteuid(); From patchwork Wed Feb 21 07:16:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Gao X-Patchwork-Id: 1901857 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=lists.linux.it header.i=@lists.linux.it header.a=rsa-sha256 header.s=picard header.b=qpSWp+nO; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=google header.b=EckL0UI8; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=patchwork.ozlabs.org) Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Tfnfc6X3lz23cl for ; Wed, 21 Feb 2024 18:17:44 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.linux.it; i=@lists.linux.it; q=dns/txt; s=picard; t=1708499862; h=to : date : message-id : in-reply-to : references : mime-version : subject : list-id : list-unsubscribe : list-archive : list-post : list-help : list-subscribe : from : reply-to : content-type : content-transfer-encoding : sender : from; bh=mCDDaS/Rn2tVhszZR9cjIbQvGxepH0s5iOu31Bc0p+w=; b=qpSWp+nOHjkN2EQ+Jp1+/XVBO2mbLrXGbPPBTvRgF0NIDozpz7OIWTuzZ4e01fdhmKijR Z3TjEcLpZQUGsUwvb2UqzD1qBr1P+EqTJF8DbQC0LUTSX9fOqCNQ0IKqIJrkSw9+JY9VJKy eM64JubuKAGk7BcT0I6giFsPbV50MB8= Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 956BD3CF189 for ; Wed, 21 Feb 2024 08:17:42 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-5.smtp.seeweb.it (in-5.smtp.seeweb.it [IPv6:2001:4b78:1:20::5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id 280193CF1AF for ; Wed, 21 Feb 2024 08:17:05 +0100 (CET) Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by in-5.smtp.seeweb.it (Postfix) with ESMTPS id 6DE07605633 for ; Wed, 21 Feb 2024 08:17:05 +0100 (CET) Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2d109e82bd0so83542851fa.3 for ; Tue, 20 Feb 2024 23:17:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1708499824; x=1709104624; darn=lists.linux.it; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=PNjFvnNZmu8Cuts904meCp6Eq6patYscqnsxYYoid9g=; b=EckL0UI8ne0RBBQ5udwbbjdpg7pa+yp1/2ZHUjOkGlBbWswqLETm/5z7u4c0ahbvhW AEiK4naSB4EgYtn6h3Cr1NM/xMOH5PdmggPjbXSvt5MeVlDgZiMzYgGlxzD0hhxAncVA 8AEpqziOVbqZ6ruogDPyi2yoVmDtl3fS5YjcAlD+VIUB8Mw2BCmRtJi9pXqnJ/hPXnlQ UvZrN3i/QCR4273LOcpOgwe8ounvvE9u6ej4cfBOWVG8DWp9wfeWc6pnVydMneH78BJ2 5RtZVnwrjc26j6V6O+9C9xbJ8J6960aUqhIgHdZKUVem/CD++cIsOspzzQ3dzSFbkB5s eAyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708499824; x=1709104624; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PNjFvnNZmu8Cuts904meCp6Eq6patYscqnsxYYoid9g=; b=DZiB/VI1/VZLzcR9Lzv6Akrr5s6bmVYsy+Nd5LjWbIARB0V32ySc9hetugR+3nv7JX TEsfMqA2ph2VWYqJStSvdeSz8Ajv/a5d2VF0UEgdd3ERYkrVgWqWUZgckEV3b/oJD631 YuEFc2HYtuRdQ/XmANYySmd0Mnac+wqqnBi1CgqNXvNJ1di/4fTDNgIyJYjfgKKUrhX/ kUwMuCEWVZZZxFayUtiYzWmaNf3b2YDEgvWTx5yVhc4/VJlgUjE5lx8BBY5dPwUF7ShY gk4aUFQOfZ8sCzNpHw+qZ2UR3+5BSowjm6jr5Fb3s02U9jn5CIBiK5IEFPNp7hv48Ok7 hk/w== X-Gm-Message-State: AOJu0YxQyjofPDfH70ts+3z+y4KcA+aspK/TPHupoNyGuydX1S4kJbBP siGuaC6LgSw0OYcbYdk4dBBbzBrUKlub1TlX+F0d68suAOrY1GB1sQI3Q2J9I+Br8f/ukjaOavw = X-Google-Smtp-Source: AGHT+IEPCuxlX8QUCtxvn4ylWueVE5AUPKg8EMaSHJ9q13iuUi4dsm/5u8VMyNXo8ZXQzMDjZPILTg== X-Received: by 2002:a2e:9192:0:b0:2d2:50ba:e5b6 with SMTP id f18-20020a2e9192000000b002d250bae5b6mr1483744ljg.10.1708499824127; Tue, 20 Feb 2024 23:17:04 -0800 (PST) Received: from localhost ([223.72.38.233]) by smtp.gmail.com with ESMTPSA id f12-20020a056a0022cc00b006e478f9504csm2997157pfj.104.2024.02.20.23.17.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 23:17:03 -0800 (PST) To: ltp@lists.linux.it Date: Wed, 21 Feb 2024 02:16:35 -0500 Message-Id: <20240221071635.17239-3-wegao@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240221071635.17239-1-wegao@suse.com> References: <20240219134845.22171-1-wegao@suse.com> <20240221071635.17239-1-wegao@suse.com> MIME-Version: 1.0 X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=disabled version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on in-5.smtp.seeweb.it X-Virus-Scanned: clamav-milter 1.0.3 at in-5.smtp.seeweb.it X-Virus-Status: Clean Subject: [LTP] [PATCH v3 2/2] statx07.c: set umask to 0022 X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Wei Gao via ltp From: Wei Gao Reply-To: Wei Gao Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" When system's default umask is 0077, this will trigger issues. Signed-off-by: Wei Gao --- testcases/kernel/syscalls/statx/statx07.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/testcases/kernel/syscalls/statx/statx07.c b/testcases/kernel/syscalls/statx/statx07.c index 4dbf83e18..1ad02fb3e 100644 --- a/testcases/kernel/syscalls/statx/statx07.c +++ b/testcases/kernel/syscalls/statx/statx07.c @@ -116,6 +116,8 @@ static void setup(void) int ret; char server_path[BUFF_SIZE]; + umask(0022); + cwd = tst_get_tmpdir(); SAFE_MKDIR(SERV_PATH, DEFAULT_MODE);