From nobody Wed Jan 03 16:50:46 2024 X-Original-To: dev-commits-src-all@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 4T4whQ48wsz56FnM; Wed, 3 Jan 2024 16:50:46 +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 4T4whQ3XxLz4l25; Wed, 3 Jan 2024 16:50:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704300646; 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=ozHjCIZz6+QBtpY/ox1ypNOr1I1wR5TUV30wc5newx0=; b=HVuYA4Mhsv8RlU2w3arE59KNoIYPJWp0q+5CKxnZZjLW1hQznSUtqHlfsIR5CxqJ44/hFg zExRyD9y/bcGRm2XSZxE3LqvUXN65TbAKPXSUWyCK4EL50rfCbdCA1libZ5awUEAvL92zK Q9/Ufr9oPMGjcPyEL74k8l+OtTvfbobSWSpjiCJen+o7leh/jerVYGecwq2yWK+SXLQeDE w7fzUy8gqj9Qzjlz0s5bXa1YBufXuO5WY1Zzv6acIRtp2/vnHpjm0FYqSWutNWi0Xl60xk AZDW2AIegMk8DTvAb0hzjjJOEipiw8Ia6PKntNsPjYmRhwxXzRuIMixp7E5PXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704300646; 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=ozHjCIZz6+QBtpY/ox1ypNOr1I1wR5TUV30wc5newx0=; b=vF/Hnj9aHRNZdWNmKFPcfvxVVO37dz/eFw/2NzbBwfM9/QfdkkpqjIVWvW6kY3Hk2qz9Ht 5BSri2KNVFBZncELqpLgiSHexRQaKRyzeBNRoEOyPFH88xnMaBg2y0b+WUyDfjxOq8uAQ+ ZnP4WRkxsTnu5rzcaoes0lHYDt9GRaOGeV0Z64/RPeT+p3YzEQM/se67pviVYXLqA8kOA+ TifNru4tjwWO6NoDPCx/to0jFWJU9RvHkvl2xdtSCHxSsCYO48Vf8R/6eWLIn5pfEIOyHh fIhP1L3iW0UWPqtMmDp048Db+52Jg7YBBsPlmlQABR1ucH3w6gabQKLzUC+n4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704300646; a=rsa-sha256; cv=none; b=tiGFRZ42+Yv+n8k1qGih1pByZ9n/tH7Fg65TuxVUmwRPq01W7LM4/hWjxfBLg+ZPcS3aSK zmofsOrfywuzt8HZY/rUp8OYbr1Q8ghsiehrc4xIiVpo5bvK7EhSqeLyvDsUaTEXgfe5ic PQl7MO7gw3kKZa2qw+SP2XrPWEq7wf9wwTcw4JGpvC5NsdZciwdCN3y6cycoQFvMj2pJb2 5xDjng6OHWCeO1eY8k6ajDDhvwtyfhWi1fwyGoApxQGlFY+I8Qtg5SHsYZb/iLyQq8+KsP XC5rsNAQw4vDAkTQsur7fM99zOMhGFHd4vutxn1a4LZFPpCX/1noV4ilUzg2Xg== 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 4T4whQ2cRvzsrL; Wed, 3 Jan 2024 16:50:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 403Gokaf042297; Wed, 3 Jan 2024 16:50:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 403Goki9042293; Wed, 3 Jan 2024 16:50:46 GMT (envelope-from git) Date: Wed, 3 Jan 2024 16:50:46 GMT Message-Id: <202401031650.403Goki9042293@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 85c9d36497fc - main - acl_equiv_mode_np: zero mode on just inited ACL List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 85c9d36497fc3a6e82932e1cb46df2670a0b9e64 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=85c9d36497fc3a6e82932e1cb46df2670a0b9e64 commit 85c9d36497fc3a6e82932e1cb46df2670a0b9e64 Author: Brooks Davis AuthorDate: 2024-01-03 16:34:39 +0000 Commit: Brooks Davis CommitDate: 2024-01-03 16:34:39 +0000 acl_equiv_mode_np: zero mode on just inited ACL You can't return 0 and not write the mode if mode_p is non-NULL. That violates the API contract and in common usage leaves stack trash in *mode_p. The acl_equiv_mode_test test passed by accident. Reviewed by: kevans, markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D43278 --- lib/libc/posix1e/acl_equiv_mode_np.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/libc/posix1e/acl_equiv_mode_np.c b/lib/libc/posix1e/acl_equiv_mode_np.c index b3bf5280493a..333b010541ee 100644 --- a/lib/libc/posix1e/acl_equiv_mode_np.c +++ b/lib/libc/posix1e/acl_equiv_mode_np.c @@ -49,7 +49,7 @@ acl_equiv_mode_np(acl_t acl, mode_t *mode_p) /* Linux returns 0 for ACL returned by acl_init() */ if (_acl_brand(acl) == ACL_BRAND_UNKNOWN && acl->ats_acl.acl_cnt == 0) - return (0); + goto done; // TODO: Do we want to handle ACL_BRAND_NFS4 in this function? */ if (_acl_brand(acl) != ACL_BRAND_POSIX) @@ -91,6 +91,7 @@ acl_equiv_mode_np(acl_t acl, mode_t *mode_p) } } +done: if (mode_p != NULL) *mode_p = ret_mode;