[LTP] [PATCH v3 4/4] cve: Add act_pedit page-cache corruption test

Petr Vorel pvorel@suse.cz
Wed Jul 8 13:41:06 CEST 2026


> Hi!
> > +static void run(void)
> > +{
> > +	struct sockaddr_in addr;
> > +	uint8_t readback[DATA_SIZE];
> > +	off_t off = 0;
> > +	int wr_fd;
> > +
> > +	wr_fd = SAFE_OPEN(TESTFILE, O_WRONLY | O_CREAT, 0444);
> > +	SAFE_WRITE(SAFE_WRITE_ALL, wr_fd, original, DATA_SIZE);
> > +	SAFE_CLOSE(wr_fd);
> > +
> > +	file_fd = SAFE_OPEN(TESTFILE, O_RDONLY);
> > +
> > +	/*
> > +	 * Clean-slate clsact qdisc so no filter is active during the
> > +	 * TCP handshake (the IHL-inflating key would corrupt SYN/ACK).
> > +	 */
> > +	tst_netdev_remove_qdisc(__FILE__, __LINE__, 0,
> > +				"lo", AF_UNSPEC, TC_H_CLSACT,
> > +				TC_H_MAKE(TC_H_CLSACT, 0), "clsact");

> This is a bit ugly. I guess that we need to add a variant for the macro
> that would set the strict to 0 into tst_netdevice.h possibly NETDEV_MAY_REMOVE_QDISC().

+1

BTW here I get error on all VMs I tested (wide range of kernel old and new and
different distros):

> 	/* Arm the pedit filter AFTER the handshake completes */
> 	NETDEV_ADD_TRAFFIC_FILTER("lo",
> 				  TC_H_MAKE(TC_H_CLSACT, TC_H_MIN_EGRESS),
> 				  0, ETH_P_ALL, 1, "matchall",
> 				  filter_config);

cve-2026-46331.c:198: TBROK: Failed to modify traffic filter: EINVAL

Leading to modify_address() in lib/tst_netdevice.c

	ret = tst_netlink_send_validate(file, lineno, ctx);
	tst_netlink_destroy_context(file, lineno, ctx);

	if (strict && !ret) {
		tst_brk_(file, lineno, TBROK,
			"Failed to modify %s network address: %s", ifname,
			tst_strerrno(tst_netlink_errno));
	}

Any idea what's wrong?

Kind regards,
Petr

> For the rest (including the preparatory patches):

> Reviewed-by: Cyril Hrubis <chrubis@suse.cz>


More information about the ltp mailing list