Page MenuHomeFreeBSD

audit(4): Syscalls dealing with {mounted/unmounted} file system statistics
ClosedPublic

Authored by aniketp on Jun 10 2018, 10:50 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 9, 2:14 AM
Unknown Object (File)
Mon, Apr 8, 11:50 PM
Unknown Object (File)
Mon, Apr 8, 11:50 PM
Unknown Object (File)
Thu, Mar 21, 8:57 AM
Unknown Object (File)
Jan 27 2024, 1:50 AM
Unknown Object (File)
Jan 27 2024, 1:50 AM
Unknown Object (File)
Jan 27 2024, 1:50 AM
Unknown Object (File)
Jan 27 2024, 1:50 AM
Subscribers

Details

Summary

The following change introduces 3 system calls dealing with retrieving file system
statistics and list of mounted filesystems. The system calls are categorized as audit
events within file-attribute-access audit class

List of system calls:

  • statfs(2)
  • fstatfs(2)
  • getfsstat(2)
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 17243
Build 17086: arc lint + arc unit

Event Timeline

Build fails.

$ make && sudo make install
(cd /usr/home/somers/freebsd/base/head/tests/sys/audit &&  DEPENDFILE=.depend.file-attribute-access  NO_SUBDIR=1 make -f /usr/home/somers/freebsd/base/head/tests/sys/audit/Makefile _RECURSING_PROGS=t  PROG=file-attribute-access )
rm -f .depend.file-attribute-access
echo file-attribute-access.full: /usr/lib/libc.a /usr/lib/libprivateatf-c.a >> .depend.file-attribute-access
cc  -O2 -pipe   -g -MD  -MF.depend.file-attribute-access.file-attribute-access.o -MTfile-attribute-access.o -std=gnu99 -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -Wmissing-variable-declarations -Wthread-safety -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable  -Qunused-arguments  -c /usr/home/somers/freebsd/base/head/tests/sys/audit/file-attribute-access.c -o file-attribute-access.o
/usr/home/somers/freebsd/base/head/tests/sys/audit/file-attribute-access.c:294:19: error: 
      use of undeclared identifier 'regex'
        check_audit(fds, regex, pipefd);
                         ^
1 error generated.                                                              
*** Error code 1

Stop.
make[1]: stopped in /usr/home/somers/freebsd/base/head/tests/sys/audit
*** Error code 1

Stop.
make: stopped in /usr/home/somers/freebsd/base/head/tests/sys/audit
This revision now requires changes to proceed.Jun 11 2018, 12:06 AM

Replace regex with extregex

Looks like there are also some file descriptors to close here.

@asomers I'll rebase this file after D15782 is committed. Since both revisions change the file: file-attribute-access.

Close file descriptor for statfs(2) and fstatfs(2) success case

It no longer compiles. I think those headers were important.

Include missing headers and struct statfs declaration

This revision is now accepted and ready to land.Jun 14 2018, 1:22 AM
This revision was automatically updated to reflect the committed changes.