Page MenuHomeFreeBSD

tests/libc: Fix fortify_source uio tests
ClosedPublic

Authored by markj on Thu, Jul 16, 8:36 PM.
Tags
None
Referenced Files
F166339712: D58289.diff
Thu, Aug 13, 12:22 AM
Unknown Object (File)
Sun, Aug 9, 8:22 PM
Unknown Object (File)
Sun, Aug 9, 9:37 AM
Unknown Object (File)
Sun, Aug 9, 9:30 AM
Unknown Object (File)
Sat, Aug 8, 5:27 AM
Unknown Object (File)
Sat, Aug 8, 1:43 AM
Unknown Object (File)
Wed, Aug 5, 6:04 AM
Unknown Object (File)
Mon, Aug 3, 4:53 AM
Subscribers

Details

Summary

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.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable