Page MenuHomeFreeBSD

Include <bsm/audit.h> in <security/audit/audit_ioctl.h> for `au_mask_t` data-type
ClosedPublic

Authored by aniketp on May 24 2018, 7:07 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 11 2024, 5:46 AM
Unknown Object (File)
Oct 11 2024, 5:46 AM
Unknown Object (File)
Oct 11 2024, 5:45 AM
Unknown Object (File)
Oct 11 2024, 5:45 AM
Unknown Object (File)
Oct 11 2024, 5:30 AM
Unknown Object (File)
Oct 4 2024, 7:37 AM
Unknown Object (File)
Oct 2 2024, 9:16 PM
Unknown Object (File)
Sep 21 2024, 3:17 AM
Subscribers

Details

Summary

The argument for auditpipe(4)'s AUDITPIPE_GET/SET_PRESELECT_AUID request is a data structure of type struct auditpipe_ioctl_preselect whose fields are not defined within the same header file. i.e security/audit/audit_ioctl.h

Here:

struct auditpipe_ioctl_preselect {
	au_id_t		aip_auid;
	au_mask_t	aip_mask;
};

has the data types au_id_t and au_mask_t whose definitions are present in bsm/audit.h. So it would be appropriate to include bsm/audit.h within security/audit/audit_ioctl.h

Bug Report: 228470

Test Plan

While working with auditpipe(4) in any application. Don't include bsm/audit.h additionally. It should work just fine with only including security/audit/audit_ioctl.h in the program.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

aniketp edited the test plan for this revision. (Show Details)
sys/security/audit/audit_ioctl.h
34 ↗(On Diff #42952)

I thought the entire point of this change was so audit_ioctl.h wouldn't have to include bsm/audit.h?

sys/security/audit/audit_ioctl.h
34 ↗(On Diff #42952)

AUDITPIPE_GET_PRESELECT_AUID uses struct auditpipe_ioctl_preselect. So one way or another, we'll have to include <bsm/audit.h> in audit_ioctl.h.

Moving the struct definitions along with the others in bsm/audit.h seemed like a cleaner approach.

sys/security/audit/audit_ioctl.h
34 ↗(On Diff #42952)

If security/audit/audit_ioctl.h must include bsm/audit.h anyway, then there's no point to moving the struct definition. Move it back.

aniketp retitled this revision from Move "struct auditpipe_ioctl_preselect" to <bsm/audit.h> from <security/audit/audit_ioctl.h> to Include <bsm/audit.h> in <security/audit/audit_ioctl.h> for `au_mask_t` data-type.
aniketp edited the summary of this revision. (Show Details)

Revert every change except importing <bsm/audit.h> into <security/audit/audit_ioctl.h>

This revision is now accepted and ready to land.May 30 2018, 8:58 PM
This revision was automatically updated to reflect the committed changes.