HomeFreeBSD

tests/libc: Fix fortify_source uio tests

Description

tests/libc: Fix fortify_source uio tests

Some of the preadv() and readv() tests were not initializing the iovecs
they pass to the system call. When the system call is expected to fail,
that's fine since the FORTIFY_SOURCE checks cause the process to be
aborted. However, in the rest of the test cases, the (p)readv() call
could cause spurious test failures, e.g., when an uninitialized iov
entry points to the current stack frame and the canary gets overwritten.

Modify the tests to explicitly initialize iov entries to avoid this.
The "iov" variants don't have this problem, so leave them alone.

Reviewed by: kevans
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58289

Details

Provenance
markjAuthored on Jul 31 2026, 2:20 PM
Reviewer
kevans
Differential Revision
D58289: tests/libc: Fix fortify_source uio tests
Parents
rGb9d07a430822: ppp: Reject invalid endpoint discriminator options
Branches
Unknown
Tags
Unknown