mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
checkescape: Treat syscall.RawSyscall() as though its arguments do not escape.
...as we do for unix.RawSyscall. PiperOrigin-RevId: 452181471
This commit is contained in:
committed by
gVisor bot
parent
c24bef7b80
commit
ad3f841aad
@@ -747,10 +747,13 @@ func run(pass *analysis.Pass, binary io.Reader) (interface{}, error) {
|
||||
// Recursively collect information.
|
||||
var funcEscapes Escapes
|
||||
if !pass.ImportObjectFact(x.Object(), &funcEscapes) {
|
||||
// If this is the unix package, and the
|
||||
// function is RawSyscall, we can also
|
||||
// ignore this case.
|
||||
if x.Pkg != nil && x.Pkg.Pkg.Name() == "unix" && (x.Name() == "RawSyscall" || x.Name() == "RawSyscall6") {
|
||||
// If this is the unix or syscall
|
||||
// package, and the function is
|
||||
// RawSyscall, we can also ignore this
|
||||
// case.
|
||||
pkgIsUnixOrSyscall := x.Pkg != nil && (x.Pkg.Pkg.Name() == "unix" || x.Pkg.Pkg.Name() == "syscall")
|
||||
methodIsRawSyscall := x.Name() == "RawSyscall" || x.Name() == "RawSyscall6"
|
||||
if pkgIsUnixOrSyscall && methodIsRawSyscall {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user