Page MenuHomeFreeBSD

Introduce test-program for ioctl(2) syscall
ClosedPublic

Authored by aniketp on Jun 17 2018, 8:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 13 2024, 4:57 AM
Unknown Object (File)
Jan 29 2024, 8:18 AM
Unknown Object (File)
Jan 29 2024, 8:18 AM
Unknown Object (File)
Jan 29 2024, 8:18 AM
Unknown Object (File)
Jan 29 2024, 8:18 AM
Unknown Object (File)
Jan 29 2024, 8:17 AM
Unknown Object (File)
Jan 27 2024, 1:02 AM
Unknown Object (File)
Dec 22 2023, 11:24 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.