[LTP] lapi: Add pkt_sched.h and pkt_cls.h fallbacks

linuxtestproject.agent@gmail.com linuxtestproject.agent@gmail.com
Mon Jul 6 16:32:36 CEST 2026


Hi Andrea,

On Mon, 7 Jul 2026 14:56:11 +0200, Andrea Cervesato wrote:
> lapi: Add pkt_sched.h and pkt_cls.h fallbacks

--- [PATCH 2/2] ---

> cve: Add act_pedit page-cache corruption test

> +	if (sendfile(cli_fd, file_fd, &off, DATA_SIZE) < 0)
> +		tst_brk(TBROK | TERRNO, "sendfile() failed");
> +
> +	/*
> +	 * Allow the loopback egress path to finish processing.
> +	 * The pedit action fires synchronously on lo, but give
> +	 * the stack a moment to drain any queued segments.
> +	 */
> +	usleep(100000);
> +
> +	SAFE_CLOSE(cli_fd);
> +	SAFE_CLOSE(acc_fd);

usleep() for synchronization is not allowed (ground rule 2).

The comment itself says the pedit action fires synchronously on lo.
If that is the case, all egress processing is complete by the time
sendfile() returns, and the sleep buys nothing.

If TCP produces multiple segments and there is a concern that not all
of them have passed through the egress filter by the time the readback
runs, the deterministic fix is to drain acc_fd before closing the
sockets:

    char sink[DATA_SIZE];
    SAFE_READ(1, acc_fd, sink, sizeof(sink));

That read blocks until all DATA_SIZE bytes have been received,
guaranteeing the full egress path -- including every pedit action --
has completed before the page-cache comparison.

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


More information about the ltp mailing list