[Bug 260547] sys.netmap.ctrl-api-test.main fails in CI

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 11 Mar 2023 00:37:41 UTC

Mark Johnston <markj@FreeBSD.org> changed:

           What    |Removed                     |Added
                 CC|                            |markj@FreeBSD.org,
                   |                            |vmaffione@FreeBSD.org
             Status|New                         |Open

--- Comment #2 from Mark Johnston <markj@FreeBSD.org> ---
I hit a different test failure in ctrl-api-test.  The problem is in the
"infinite options" test.

Since commit 253b2ec199b831cacc022b58cb38c3e3c29c1a8f, nmreq_copyin() does some
extra validation of the option linked list, but that appears to break the test
and prevents an infinite loop only by accident.

In particular, if multiple options have the same req type, the loop just skips
to the next option.  But after the first iteration, opt->nro_next will be a
kernel pointer not a user point, and then the subsequent copyin() fails because
netmap is trying to copyin from a kernel address.  This causes the test to fail
since the ioctl returns EFAULT instead of EMSGSIZE.  If not for that bug, I
think there would be an infinite loop.

There is a second bug there in that "error" is set in some of those error
cases, but the next iteration can set "error" back to 0.

If I disable the infinite_options test, everything else passes for me.  So it'd
be nice to fix the kernel and re-enable the netmap tests in CI.

You are receiving this mail because:
You are the assignee for the bug.