From owner-freebsd-testing@freebsd.org Tue Oct 13 23:12:07 2020 Return-Path: Delivered-To: freebsd-testing@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 36D7B44DCC3 for ; Tue, 13 Oct 2020 23:12:07 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 4C9rsg0kpHz4QKY for ; Tue, 13 Oct 2020 23:12:07 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 18ED744DCC2; Tue, 13 Oct 2020 23:12:07 +0000 (UTC) Delivered-To: testing@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 17A8744DFB3 for ; Tue, 13 Oct 2020 23:12:07 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9rsf6wMqz4QKX for ; Tue, 13 Oct 2020 23:12:06 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D0E562518B for ; Tue, 13 Oct 2020 23:12:06 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 09DNC6OL052963 for ; Tue, 13 Oct 2020 23:12:06 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 09DNC6ok052962 for testing@FreeBSD.org; Tue, 13 Oct 2020 23:12:06 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: testing@FreeBSD.org Subject: [Bug 250178] Failing test case: sys.capsicum.functional.Capability__NoBypassDAC Date: Tue, 13 Oct 2020 23:12:06 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: tests X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: emaste@freebsd.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: testing@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-testing@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Testing on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 23:12:07 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D250178 --- Comment #3 from Ed Maste --- 1281 TEST(Capability, NoBypassDAC) { 1282 REQUIRE_ROOT(); 1283 int fd =3D open(TmpFile("cap_root_owned"), O_RDONLY|O_CREAT, 0644= ); 1284 EXPECT_OK(fd); 1285 cap_rights_t rights; 1286 cap_rights_init(&rights, CAP_READ, CAP_WRITE, CAP_FCHMOD, CAP_FST= AT); 1287 EXPECT_OK(cap_rights_limit(fd, &rights)); 1288 1289 pid_t child =3D fork(); 1290 if (child =3D=3D 0) { 1291 // Child: change uid to a lesser being 1292 setuid(other_uid); 1293 // Attempt to fchmod the file, and fail. 1294 // Having CAP_FCHMOD doesn't bypass the need to comply with DAC policy. 1295 int rc =3D fchmod(fd, 0666); 1296 EXPECT_EQ(-1, rc); 1297 EXPECT_EQ(EPERM, errno); 1298 exit(HasFailure()); 1299 } 1300 int status; 1301 EXPECT_EQ(child, waitpid(child, &status, 0)); 1302 EXPECT_TRUE(WIFEXITED(status)) << "0x" << std::hex << status; 1303 EXPECT_EQ(0, WEXITSTATUS(status)); 1304 struct stat info; 1305 EXPECT_OK(fstat(fd, &info)); 1306 EXPECT_EQ((mode_t)(S_IFREG|0644), info.st_mode); 1307 close(fd); 1308 unlink(TmpFile("cap_root_owned")); 1309 } --=20 You are receiving this mail because: You are the assignee for the bug.=