Page MenuHomeFreeBSD

audit(4): Add tests for setsid(2), wait4(2), wait6(2) and kill(2)
ClosedPublic

Authored by aniketp on Jun 27 2018, 11:30 AM.

Details

Summary

This revision introduces atf-c(3) tests for verifying the proper auditability for
syscalls categorized within process-control audit class.
List of syscalls:

  • setsid(2)
  • wait4(2)
  • wait6(2)
  • kill(2)
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
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

aniketp created this revision.Jun 27 2018, 11:30 AM
asomers requested changes to this revision.Jun 27 2018, 3:37 PM
asomers added inline comments.
tests/sys/audit/process-control.c
986 ↗(On Diff #44517)

This assumes too much about Kyua's execution model. You shouldn't assume that it's already a process group leader. For example, if you invoke the test as sudo ./process-control setsid_failure, then it will fail.

This revision now requires changes to proceed.Jun 27 2018, 3:37 PM
aniketp updated this revision to Diff 44536.Jun 27 2018, 4:56 PM
  • Call setsid() prematurely to intentionally fail the tests
asomers requested changes to this revision.Jun 27 2018, 4:59 PM
asomers added inline comments.
tests/sys/audit/process-control.c
982 ↗(On Diff #44536)

This should work. But I would prefer a comment that indicates that we're intentionally ignoring the output of the first setsid call, because we don't know whether we're already a session leader.

This revision now requires changes to proceed.Jun 27 2018, 4:59 PM
aniketp updated this revision to Diff 44542.Jun 27 2018, 5:26 PM
  • Update comment explaining why we are ignoring the output of first setsid()
asomers accepted this revision.Jun 29 2018, 4:37 AM
This revision is now accepted and ready to land.Jun 29 2018, 4:37 AM
This revision was automatically updated to reflect the committed changes.