From nobody Tue Nov 15 14:32:10 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NBTCZ3v0Dz4fdWn; Tue, 15 Nov 2022 14:32:10 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NBTCZ3QwFz3Pwx; Tue, 15 Nov 2022 14:32:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668522730; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TX3ZBpiQVogqr9g37LlwnSmjO6ADKOx0v/ILE7jnS6w=; b=ah3kA67PcuYnXPRz/LUCA0UBtdh6K7FXQh9wy0F5PXM8kxO7UOqBu+iM4vDoRogibr2nsu NE03mUZ74NZ1eWBNoUkDiMlD4Bp8LwPsYNrIlqJ1uXDvQeM5DANJJiQq6/WeLrwvYsCAUZ sJITN7hZvClkLfjDlFEPNLdZNtJlMFj7Uk+UYH9WwGI3aXohGCxkTbKsQIM8IDCXsxxD6z 1qvsdsjELWkvWQL4ihCVRj7TZtflmWwC60wg2wrMosLaItqkDgykYyr3g9amGOat1Fr7vC 5OZMXQQ6z2xWQNKDW7uQerBbpSNkz4L3O5jXTOvNWsw6n+i5M0ZZCRKK1I0rxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668522730; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TX3ZBpiQVogqr9g37LlwnSmjO6ADKOx0v/ILE7jnS6w=; b=NvTI6ZmT0wlk3rehGCOa40wfxOvwru3fDunou/FNgBDpti5YutLnGne849ArrdDSkyqBaz W1M39mL2HVaSg1VcFVUbMyCmArue47n1oeKad9S5Fzd7PyMCD3aYAo1s/D0iegdjyWqKbw aL/10ZeT0XR9xit3IdYtIcskrRWTtYraDjQmUUeztMUuo246Tl48laAZBxxRXNJ/SoPOuT YWd0jdSRXE4y7CiqDIrfJeio8VUHm/ujvWsujiMXB008W2Mtany/bSL0oV6SZ+o2ldoPwI 9CKXjk+GWiIb7XCfY8KoD1KB3GEW04JTnaTBeIY09n95TiZfVnDMYp9LMlAQ3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1668522730; a=rsa-sha256; cv=none; b=E0xbgufDNgoDiEwDPXOMK2k9gdIDGD6w4lauSAxRayzc0uBllik/Hout4OGB7B2rjSLTD5 5O12S43rpGuNSEVfGhOCauYfj2GR5zcq8DvLXof+nb2Em3buUKGfEOhl9lAo1jrlzk4ip0 IGNWzAxMJZDpNt4Isr6AuIVA9yEe3I+ZOpLwauYxk/YqGZXbiY21z0QbF2dLRSu6ULWbU+ CTyIZbfhJ5SQlYDjGOxhGNpDsPwPTxgXdUjrJ+53x8b3dgeeiTk0MSqZYNbpxh/mcunJ7A cbIbZI0zpqEco3xxmpDrNu36zhQOLb2U+Xxw3qAq9brWxWgdOBGAA7fbxh1aVQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 4NBTCZ2Vf7zQk2; Tue, 15 Nov 2022 14:32:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2AFEWAR5057218; Tue, 15 Nov 2022 14:32:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2AFEWAiP057217; Tue, 15 Nov 2022 14:32:10 GMT (envelope-from git) Date: Tue, 15 Nov 2022 14:32:10 GMT Message-Id: <202211151432.2AFEWAiP057217@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 60bae7ec045a - main - mac_lomac: whack giant usage List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 60bae7ec045a8af6e9c51ac080e51948fe84bb4d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=60bae7ec045a8af6e9c51ac080e51948fe84bb4d commit 60bae7ec045a8af6e9c51ac080e51948fe84bb4d Author: Mateusz Guzik AuthorDate: 2022-11-15 14:31:41 +0000 Commit: Mateusz Guzik CommitDate: 2022-11-15 14:31:41 +0000 mac_lomac: whack giant usage It does not protect anything, the code looks dodgy regardless. --- sys/security/mac_lomac/mac_lomac.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/sys/security/mac_lomac/mac_lomac.c b/sys/security/mac_lomac/mac_lomac.c index 5efcfe385cd5..dffd06d964a2 100644 --- a/sys/security/mac_lomac/mac_lomac.c +++ b/sys/security/mac_lomac/mac_lomac.c @@ -2248,12 +2248,6 @@ lomac_thread_userret(struct thread *td) dodrop = 0; mtx_unlock(&subj->mtx); newcred = crget(); - /* - * Prevent a lock order reversal in mac_proc_vm_revoke; - * ideally, the other user of subj->mtx wouldn't be holding - * Giant. - */ - mtx_lock(&Giant); PROC_LOCK(p); mtx_lock(&subj->mtx); /* @@ -2275,7 +2269,6 @@ lomac_thread_userret(struct thread *td) PROC_UNLOCK(p); if (dodrop) mac_proc_vm_revoke(curthread); - mtx_unlock(&Giant); } else { mtx_unlock(&subj->mtx); }