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)
Fri, Feb 14, 9:59 AM
Unknown Object (File)
Thu, Feb 13, 5:12 AM
Unknown Object (File)
Jan 18 2025, 1:54 PM
Unknown Object (File)
Jan 18 2025, 7:38 AM
Unknown Object (File)
Jan 17 2025, 3:40 PM
Unknown Object (File)
Jan 15 2025, 3:13 AM
Unknown Object (File)
Dec 16 2024, 2:44 PM
Unknown Object (File)
Dec 4 2024, 5:16 PM
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

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 17342
Build 17177: arc lint + arc unit

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
124

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.

303

s/failur/failure

379

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

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.