Page MenuHomeFreeBSD

Introduce test-program for ioctl(2) syscall
ClosedPublic

Authored by aniketp on Jun 17 2018, 8:30 PM.
Tags
None
Referenced Files
F139443101: D15872.diff
Fri, Dec 12, 3:46 AM
F139419407: D15872.id44048.diff
Thu, Dec 11, 9:10 PM
Unknown Object (File)
Tue, Nov 25, 11:15 AM
Unknown Object (File)
Mon, Nov 24, 6:17 AM
Unknown Object (File)
Mon, Nov 24, 5:31 AM
Unknown Object (File)
Sun, Nov 23, 10:21 PM
Unknown Object (File)
Thu, Nov 20, 11:28 PM
Unknown Object (File)
Thu, Nov 20, 11:28 PM
Subscribers

Details

Summary

This revision introduces the test-program for ioctl audit class which only contains
ioctl(2) as the audit event.

Test Plan

Execute make && make install from test/sys/audit.
Execute kyua test from /usr/tests/sys/audit. All testcases should succeed.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

asomers added inline comments.
tests/sys/audit/ioctl.c
57 ↗(On Diff #43969)

ioctl is superversatile. Does it audit the request too? If so, can you test for that in the regex?

61 ↗(On Diff #43969)

This is probably not a good ioctl to test with, because it might flush the audit record of interest. How about something more harmless, like AUDITPIPE_GET_QLIMIT ?

This revision now requires changes to proceed.Jun 17 2018, 10:18 PM

Verify the audit of hex(request) in the ioctl(2)'s audit record

@asomers I have opened a separate instance of /dev/auditpipe for the test-case, so it doesn't
matter what is flushed from this device instance, since it is not of our concern.
Also, I pondered initially about which request to use, I chose AUDITPIPE_FLUSH because
it is the simplest of all available options.

tests/sys/audit/ioctl.c
59 ↗(On Diff #43987)

Pro tip: the "#" character tells printf(3) to use an "alternate form", which has different meanings depending on the type of conversion. For example, printf("%#x", 16) will print 0xa.

  • Update the format specifier to %#lx instead of 0x%x
This revision is now accepted and ready to land.Jun 19 2018, 12:46 AM
This revision was automatically updated to reflect the committed changes.