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)
Sat, Apr 13, 12:17 PM
Unknown Object (File)
Sat, Apr 13, 11:48 AM
Unknown Object (File)
Sat, Apr 13, 9:19 AM
Unknown Object (File)
Jan 27 2024, 1:21 AM
Unknown Object (File)
Jan 27 2024, 1:21 AM
Unknown Object (File)
Jan 27 2024, 1:21 AM
Unknown Object (File)
Jan 27 2024, 1:21 AM
Unknown Object (File)
Jan 27 2024, 1:01 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.