Page MenuHomeFreeBSD

System V standardized IPC syscalls for manipulating shared memory segments
ClosedPublic

Authored by aniketp on Jun 17 2018, 12:48 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 3, 2:59 PM
Unknown Object (File)
Sep 26 2024, 7:24 AM
Unknown Object (File)
Sep 24 2024, 7:20 PM
Unknown Object (File)
Sep 22 2024, 1:48 AM
Unknown Object (File)
Sep 21 2024, 2:51 AM
Unknown Object (File)
Sep 17 2024, 4:46 AM
Unknown Object (File)
Sep 10 2024, 6:34 PM
Unknown Object (File)
Sep 9 2024, 12:13 AM
Subscribers

Details

Summary

This revision introduces test cases for System V standardized system calls concerned
with creating and manipulating shared memory segments. These system calls are categorized
within inter-process-communication audit class (as expected).

System calls in question are:

  • shmget(2)
  • shmat(2)
  • shmdt(2)
  • shmctl(2)

Note:
shmctl(2) takes as argument a cmd which is a separate audit event in itself.
List of shmctl(2) audit events:

  • AUE_SHMCTL [Illegal Command]
  • AUE_SHMCTL_STAT
  • AUE_SHMCTL_RMID
  • AUE_SHMCTL_SET

For full details, please see: sys/security/audit/audit_bsm_klib.c#L113

Each of them have been treated as separate audit events. (And hence, separate tests)

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

This revision is now accepted and ready to land.Jun 17 2018, 3:08 PM
asomers requested changes to this revision.Jun 17 2018, 3:12 PM
asomers added inline comments.
tests/sys/audit/inter-process.c
459 ↗(On Diff #43928)

This line fails to compile for 32-bit architectures. You should cast to intptr_t instead of int.

This revision now requires changes to proceed.Jun 17 2018, 3:12 PM

Replace int with intptr_t for ATF_REQUIRE statements of shmat(2) and shmdt(2)

asomers requested changes to this revision.Jun 17 2018, 5:50 PM
asomers added inline comments.
tests/sys/audit/inter-process.c
463 ↗(On Diff #43952)

You missed one. FYI: you can compile test yourself by doing "ARCH=i386 TARGET_ARCH=i386 make -jwhatever buildworld".

This revision now requires changes to proceed.Jun 17 2018, 5:50 PM

Remove (int)addr from regex it is not required (We already have the shmid to match against)

This revision is now accepted and ready to land.Jun 17 2018, 9:27 PM
This revision was automatically updated to reflect the committed changes.