All of lore.kernel.org
 help / color / mirror / Atom feed
From: linuxtestproject.agent@gmail.com
To: Petr Vorel <pvorel@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] test macros: Fix TST_EXP_FD_OR_FAIL()
Date: Tue, 11 Aug 2026 16:05:55 +0000	[thread overview]
Message-ID: <20260811160555.9333-1-linuxtestproject.agent@gmail.com> (raw)
In-Reply-To: <20260811155202.1744316-2-pvorel@suse.cz>

Hi Petr,

On Tue, 11 Aug 2026, Petr Vorel wrote:
> test macros: Fix TST_EXP_FD_OR_FAIL()

--- [PATCH 3/4] ---

> +	TST_EXP_PASS_OR_FAIL(finit_module(fd, "status=valid", 0), err);
>  	if (!TST_PASS)
>  		return;

Could this return when err is nonzero as well?  An expected EKEYREJECTED
sets TST_PASS, so the signature-enforcement path continues to
tst_module_unload() even though the module was never loaded.  The rmmod
retries then end the test with TBROK.  The same issue is present in
init_module01.c.

> +	TST_EXP_FD_OR_FAIL(fd = open(FILE_TRUNCATE, O_WRONLY | O_TRUNC, PERM_MODE), exp_err);
> +	if (fd != -1) {
> +		TST_EXP_PASS_OR_FAIL(ftruncate(fd, 10), exp_err);
> +		SAFE_CLOSE(fd);
>  	}
> +
> +	TST_EXP_FD_OR_FAIL(fd = open(FILE_TRUNCATE, O_WRONLY | O_TRUNC, PERM_MODE), exp_err);

Could the first open keep O_WRONLY without O_TRUNC?  In the
LANDLOCK_ACCESS_FS_WRITE_FILE-only variant, O_TRUNC is denied, fd remains
-1, and the ftruncate() check is skipped.  The next identical open then
tests O_TRUNC twice.

--- [PATCH 4/4] ---

> diff --git a/lib/newlib_tests/test_macros04.c b/lib/newlib_tests/test_macros04.c
> deleted file mode 100644

Could the test_macros04 entry be removed from lib/newlib_tests/.gitignore
along with the deleted test?

Verdict - Needs revision

---
Note:

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

  reply	other threads:[~2026-08-11 16:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-11 15:51 [LTP] [PATCH v3 0/4] test_macros: Add TST_EXP_PASS_OR_FAIL() Petr Vorel
2026-08-11 15:51 ` [LTP] [PATCH v3 1/4] test macros: Fix TST_EXP_FD_OR_FAIL() Petr Vorel
2026-08-11 16:05   ` linuxtestproject.agent [this message]
2026-08-11 15:52 ` [LTP] [PATCH v3 2/4] test_macros: Add TST_EXP_PASS_OR_FAIL() Petr Vorel
2026-08-11 15:52 ` [LTP] [PATCH v3 3/4] tree: Use TST_EXP_PASS_OR_FAIL() and TST_EXP_FD_OR_FAIL() Petr Vorel
2026-08-11 15:52 ` [LTP] [PATCH v3 4/4] test_macros*.c: Simplify with macros macros Petr Vorel

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=20260811160555.9333-1-linuxtestproject.agent@gmail.com \
    --to=linuxtestproject.agent@gmail.com \
    --cc=ltp@lists.linux.it \
    --cc=pvorel@suse.cz \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.