Skip to content

Commit c156db0

Browse files
andrewkrohph
authored andcommitted
Add s390 and s390x to runtime arch list (#23)
Detect s390 or s390x as the runtime architecture (GOOS) and automatically use the appropriate syscall name to number table without requiring the rule to explicitly specify an arch (`-F arch=s390x`). Prior to this change, `-F arch=s390` or `-F arch=s390x` was required in a syscall audit rule for these architectures.
1 parent 28a94fc commit c156db0

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
66

77
### Added
88

9+
- rules - Detect s390 or s390x as the runtime architecture (GOOS) and
10+
automatically use the appropriate syscall name to number table without
11+
requiring the rule to explicitly specify an arch (`-F arch=s390x`). #23
12+
913
### Changed
1014

1115
### Deprecated

rule/rule.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ func getArch(arch string) (string, uint32, error) {
560560
return realArch, archValue, nil
561561
}
562562

563-
// getRuntimeArch returns the programs arch (not the machines arch).
563+
// getRuntimeArch returns the program's arch (not the machine's arch).
564564
func getRuntimeArch() (string, error) {
565565
var arch string
566566
switch runtime.GOARCH {
@@ -574,6 +574,10 @@ func getRuntimeArch() (string, error) {
574574
arch = "x86_64"
575575
case "ppc64", "ppc64le":
576576
arch = "ppc"
577+
case "s390":
578+
arch = "s390"
579+
case "s390x":
580+
arch = "s390x"
577581
case "mips", "mipsle", "mips64", "mips64le":
578582
fallthrough
579583
default:

0 commit comments

Comments
 (0)