From: linuxtestproject.agent@gmail.com
To: Wei Gao <wegao@suse.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] lib: New library function tst_get_free_uid
Date: Wed, 15 Apr 2026 11:08:09 +0000 [thread overview]
Message-ID: <20260415110809.3987-1-linuxtestproject.agent@gmail.com> (raw)
In-Reply-To: <20260415103812.21999-2-wegao@suse.com>
Hi Wei,
On Wed, 15 Apr 2026, Wei Gao wrote:
> open16: allow restricted O_CREAT of FIFOs and regular files
--- [PATCH 2/2] ---
On Wed, 15 Apr 2026, Wei Gao wrote:
> open16: allow restricted O_CREAT of FIFOs and regular files
> + SAFE_FILE_PRINTF(PROTECTED_REGULAR, "2");
> + SAFE_FILE_PRINTF(PROTECTED_FIFOS, "2");
> + SAFE_CHMOD(DIR, 0020 | S_ISVTX);
> +
> + if (!SAFE_FORK()) {
> + SAFE_SETUID(uid2);
> + TST_EXP_FAIL(openat(dir_fd, TEST_FILE, O_RDWR | O_CREAT, 0777), EACCES);
> + TST_EXP_FAIL(open(TEST_FIFO_PATH, O_RDWR | O_CREAT, 0777), EACCES);
uid2 is a free (unused) UID with no group memberships. With mode 0020|S_ISVTX
the "other" bits are 0, so the kernel's DAC check rejects openat/open before
reaching the protected_regular/protected_fifos logic in may_open(). EACCES
fires for the wrong reason.
For a valid level-2 test the directory needs group-execute and group-write
(e.g. 0770|S_ISVTX), and uid2 must be placed in the directory's owning group
so it can access the directory but is still blocked by the protection check.
---
Note:
Our agent completed the review of the patch. The full review can be
found at: <review_url>
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2026-04-15 11:08 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-09 11:20 [LTP] [PATCH v1] open15: allow restricted O_CREAT of FIFOs and regular files Wei Gao via ltp
2023-12-08 15:34 ` Cyril Hrubis
2023-12-27 13:05 ` [LTP] [PATCH v2] " Wei Gao via ltp
2024-02-26 13:37 ` Cyril Hrubis
2024-06-03 12:55 ` [LTP] [PATCH v3] " Wei Gao via ltp
2025-02-21 10:01 ` Andrea Cervesato via ltp
2025-03-19 14:23 ` [LTP] [PATCH v4] open16: " Wei Gao via ltp
2025-07-11 12:04 ` Cyril Hrubis
2025-07-23 15:46 ` [LTP] [PATCH v5] " Wei Gao via ltp
2026-02-18 13:21 ` Andrea Cervesato via ltp
2026-04-15 6:07 ` [LTP] [PATCH v6 0/2] " Wei Gao via ltp
2026-04-15 6:07 ` [LTP] [PATCH v6 1/2] lib: New library function tst_get_free_uid Wei Gao via ltp
2026-04-15 7:54 ` [LTP] " linuxtestproject.agent
2026-04-15 6:07 ` [LTP] [PATCH v6 2/2] open16: allow restricted O_CREAT of FIFOs and regular files Wei Gao via ltp
2026-04-15 10:37 ` [LTP] [PATCH v6 0/2] " Wei Gao via ltp
2026-04-15 10:37 ` [LTP] [PATCH v7 1/2] lib: New library function tst_get_free_uid Wei Gao via ltp
2026-04-15 11:08 ` linuxtestproject.agent [this message]
2026-04-16 0:55 ` [LTP] [PATCH v8 0/2] open16: allow restricted O_CREAT of FIFOs and regular files Wei Gao via ltp
2026-04-16 0:55 ` [LTP] [PATCH v8 1/2] lib: New library function tst_get_free_uid Wei Gao via ltp
2026-04-16 2:43 ` [LTP] " linuxtestproject.agent
2026-04-16 4:15 ` Wei Gao via ltp
2026-04-16 0:55 ` [LTP] [PATCH v8 2/2] open16: allow restricted O_CREAT of FIFOs and regular files Wei Gao via ltp
2026-04-15 10:37 ` [LTP] [PATCH v7 " Wei Gao via ltp
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260415110809.3987-1-linuxtestproject.agent@gmail.com \
--to=linuxtestproject.agent@gmail.com \
--cc=ltp@lists.linux.it \
--cc=wegao@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox