Skip to content

Commit

Permalink
Update syscall/arches/audit msg tables for linux 5.16 (#96)
Browse files Browse the repository at this point in the history
* Update syscall/arches/audit msg tables for linux 5.16

This updates the tables based on kernel 5.16. `go generate` was
run inside of the vagrant box include in the project.

ia64 was deprecated upstream so its removed (and wasn't supported by Go).

* Update CHANGELOG.md
  • Loading branch information
andrewkroh committed Jan 28, 2022
1 parent 8189891 commit 037b556
Show file tree
Hide file tree
Showing 10 changed files with 1,019 additions and 977 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ This project adheres to [Semantic Versioning](http://semver.org/).

### Changed

- Update syscall, arches, and audit msg type tables for Linux 5.16. [#96](https://github.com/elastic/go-libaudit/pull/96)

### Removed

- Removed support for resolving syscall numbers to names for the ia64 architecture. [#96](https://github.com/elastic/go-libaudit/pull/96)

### Deprecated

## [2.2.0]
Expand Down
2 changes: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SCRIPT
install_gvm = <<SCRIPT
mkdir -p ~/bin
if [ ! -e "~/bin/gvm" ]; then
curl -sL -o ~/bin/gvm https://github.com/andrewkroh/gvm/releases/download/v0.2.2/gvm-linux-amd64
curl -sL -o ~/bin/gvm https://github.com/andrewkroh/gvm/releases/download/v0.4.0/gvm-linux-amd64
chmod +x ~/bin/gvm
~/bin/gvm #{GO_VERSION}
echo 'export GOPATH=$HOME/go' >> ~/.bash_profile
Expand Down
8 changes: 8 additions & 0 deletions auparse/defs_audit_arches.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions auparse/mk_audit_arches.pl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

my $command = "mk_audit_arches.pl ". join(' ', @ARGV);

`curl -s -O https://github.com/raw/torvalds/linux/v4.16/include/uapi/linux/audit.h`;
`curl -s -O https://github.com/raw/torvalds/linux/v5.16/include/uapi/linux/audit.h`;

open(GCC, "gcc -E -dD audit.h |") || die "can't run gcc";
my @arches;
Expand All @@ -30,7 +30,7 @@
close GCC;

# Filter arches not known by compiler.
@arches = grep {! /(TILE|OPENRISC|ALPHA|MICROBLAZE)/} @arches;
@arches = grep {! /(TILE|OPENRISC|ALPHA|MICROBLAZE|ARCOMPACT|ARCV2|CSKY|HEXAGON|NDS32|RISCV|UNICORE|XTENSA)/} @arches;

my $outfile = 'defs_audit_arches.go';
open (FILE, "> $outfile") || die "problem opening $outfile\n";
Expand Down
3 changes: 3 additions & 0 deletions auparse/mk_audit_exit_codes.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ func readErrorNumbers() ([]ErrorNumber, error) {
}

sort.Slice(errnos, func(i, j int) bool {
if errnos[i].Value == errnos[j].Value {
return errnos[i].Name < errnos[j].Name
}
return errnos[i].Value < errnos[j].Value
})

Expand Down
6 changes: 3 additions & 3 deletions auparse/mk_audit_msg_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ var tmpl = template.Must(template.New("message_types").Parse(fileTemplate))

var (
headers = []string{
`https://github.com/raw/torvalds/linux/v4.16/include/uapi/linux/audit.h`,
`https://github.com/raw/linux-audit/audit-userspace/4d933301b1835cafa08b9e9ef705c8fb6c96cb62/lib/libaudit.h`,
`https://github.com/raw/linux-audit/audit-userspace/4d933301b1835cafa08b9e9ef705c8fb6c96cb62/lib/msg_typetab.h`,
`https://github.com/raw/torvalds/linux/v5.16/include/uapi/linux/audit.h`,
`https://github.com/raw/linux-audit/audit-userspace/v3.0.7/lib/libaudit.h`,
`https://github.com/raw/linux-audit/audit-userspace/v3.0.7/lib/msg_typetab.h`,
}
)

Expand Down
3 changes: 1 addition & 2 deletions auparse/mk_audit_syscalls.pl
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@ sub fmt {
print "\t\t$num: \"$name\",\n";
}

my $base_url = "https://github.com/raw/linux-audit/audit-userspace/4d933301b1835cafa08b9e9ef705c8fb6c96cb62/lib";
my $base_url = "https://github.com/raw/linux-audit/audit-userspace/v3.0.7/lib";
my @tables = (
"aarch64",
"arm",
"i386",
"ia64",
"ppc",
"s390",
"s390x",
Expand Down
8 changes: 8 additions & 0 deletions auparse/zaudit_arches.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 037b556

Please sign in to comment.