Page MenuHomeFreeBSD

Introduce test-program for System V standardized IPC syscalls
ClosedPublic

Authored by aniketp on Jun 16 2018, 6:52 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 20, 6:36 AM
Unknown Object (File)
Sun, Nov 17, 7:36 AM
Unknown Object (File)
Fri, Nov 15, 6:30 AM
Unknown Object (File)
Wed, Nov 13, 12:49 PM
Unknown Object (File)
Sep 24 2024, 11:45 PM
Unknown Object (File)
Sep 23 2024, 6:04 PM
Unknown Object (File)
Sep 5 2024, 2:37 PM
Unknown Object (File)
Aug 13 2024, 4:38 AM
Subscribers

Details

Summary

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

System calls in question are:

  • msgget(2)
  • msgsnd(2)
  • msgrcv(2)
  • msgctl(2)

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

  • AUE_MSGCTL [Illegal Command]
  • AUE_MSGCTL_STAT
  • AUE_MSGCTL_RMID
  • AUE_MSGCTL_SET

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

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

aniketp set the repository for this revision to rS FreeBSD src repository - subversion.
asomers requested changes to this revision.Jun 16 2018, 2:44 PM
asomers added inline comments.
tests/sys/audit/inter-process.c
123 ↗(On Diff #43880)

You're sending uninitialized data here, since msgsize is 128 but only the first 15B of the message are initialized. You should send only the true length of the message.

302 ↗(On Diff #43880)

s/failur/failure

378 ↗(On Diff #43880)

s/failur/failure

This revision now requires changes to proceed.Jun 16 2018, 2:44 PM

Update the test-program to send only the initialized data using msgsnd(2)

tests/sys/audit/inter-process.c
118 ↗(On Diff #43898)

This takes the address of samplemsg and casts that to a char. I don't think that's what you want.

Tweak in the msgstr_t variables' initialization

This revision was not accepted when it landed; it landed in state Needs Review.Jun 16 2018, 6:22 PM
This revision was automatically updated to reflect the committed changes.