Page MenuHomeFreeBSD

Add tests for pipe(2) and POSIX standardized IPC syscalls
ClosedPublic

Authored by aniketp on Jun 22 2018, 4:51 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 4, 11:02 AM
Unknown Object (File)
Oct 13 2024, 7:52 AM
Unknown Object (File)
Oct 3 2024, 10:02 PM
Unknown Object (File)
Oct 3 2024, 6:10 PM
Unknown Object (File)
Sep 28 2024, 5:02 AM
Unknown Object (File)
Sep 5 2024, 8:01 PM
Unknown Object (File)
Sep 3 2024, 4:23 PM
Unknown Object (File)
Sep 2 2024, 11:29 PM
Subscribers

Details

Summary

This revision introduces test cases for following set of syscalls within inter-process
communication audit class.

  • shm_open(2)
  • shm_unlink(2)
  • posix_openpt(2)
  • pipe(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 - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Do these complete the IPC set?

tests/sys/audit/inter-process.c
1416 ↗(On Diff #44292)

New code should use strlcat instead of strncat.

1422 ↗(On Diff #44292)

shared memory segments are actually persistent. So the unlink steps needs to go in the cleanup function. However, if you create the object with SHM_ANON for path, then it will be automatically destroyed.

1510 ↗(On Diff #44292)

The file descriptors are outputs from pipe(2), not inputs to it. Don't initialize them with open.

1542 ↗(On Diff #44292)

I'm surprised this doesn't segfault. Better to use NULL. Or, just use pipe2 with invalid flags. pipe(2) is actually a wrapper around pipe2(2). If you really want to test the pipe(2) syscall, you'll have to do it the same way you tested open(2), but using syscall(2). However, pipe and pipe2 both have the same audit event, AUE_PIPE.

aniketp marked 4 inline comments as done.

Changes as suggested in the inline comments

asomers added inline comments.
tests/sys/audit/inter-process.c
1459 ↗(On Diff #44315)

No need for the -1.

This revision now requires changes to proceed.Jun 22 2018, 10:29 PM

Remove -1 from strlcat() in shm_inlink_success test case

This revision is now accepted and ready to land.Jun 23 2018, 6:38 PM
This revision was automatically updated to reflect the committed changes.