15 Commits
Author SHA1 Message Date
Ayush RanjanandgVisor bot 421d63ebbc Fix unsigned to signed integer conversion in syserr.getHostTranslation().
unix.Errno is of type `uintptr`, which is an unsigned integer. It was being
casted to `int`, which is a signed integer of the same size. This cast could
overflow due to unsigned -> signed.

Reported-by: [email protected]
PiperOrigin-RevId: 680668525
2024-09-30 12:11:53 -07:00
Ayush RanjanandgVisor bot 5e4e417885 Remove linuxerr.IsValid and use syserr.IsValid instead.
linuxerr.IsValid just checks if the errno is less than the max possible errno
value. syserr.IsValid additionally checks if the errno can be translated by the
syserr package.

Furthermore, drop the usage of linuxerr.TranslateError(), which only checks
against a map with 3 entries of sentry-internal errors. Earlier, connError()
would always fail at this step and end up returning linuxerr.EINVAL even if the
errno being returned is valid.

Reported-by: [email protected]
PiperOrigin-RevId: 680021716
2024-09-28 12:34:57 -07:00
Ayush RanjanandgVisor bot bd753ad4da Add EHWPOISON to host_linux.go
Reported-by: [email protected]
PiperOrigin-RevId: 671639531
2024-09-05 23:19:47 -07:00
Nayana BidariandgVisor bot 1bbd7acdff Add ERFKILL errno to host_linux file.
Reported-by: [email protected]
PiperOrigin-RevId: 663361199
2024-08-15 10:43:38 -07:00
Ayush RanjanandgVisor bot dec2f6598f Add ENAVAIL to host_linux.go.
Reported-by: [email protected]
PiperOrigin-RevId: 658858051
2024-08-02 11:53:26 -07:00
Ayush RanjanandgVisor bot bf153d9b57 Add EISNAM to linuxHostTranslations and fix error message for ENOTNAM.
Reported-by: [email protected]
PiperOrigin-RevId: 658584815
2024-08-01 16:57:38 -07:00
Kevin KrakauerandgVisor bot b0a445bfc3 netstack: remove {linux,darwin}HostTranslation
It can be replaced with a simpler type.

PiperOrigin-RevId: 409533054
2021-11-12 16:24:59 -08:00
Kevin KrakauerandgVisor bot 5809afdaf6 netstack: fix Mac build error
- Stub out sighandling functions with panics on Darwin
- Put Linux-specific errors into their own syserr file

Not sure how best to get automated tests running, so I'll leave that for a later
change.

Fixes #6839.
Related to #1270.

PiperOrigin-RevId: 409516969
2021-11-12 15:24:47 -08:00
Jamie LiuandgVisor bot f53b8a38e5 Add go:build directives as required by Go 1.17's gofmt.
PiperOrigin-RevId: 385894869
2021-07-20 16:28:45 -07:00
Ayush RanjanandgVisor bot c3ff9f93bc [op] Replace syscall package usage with golang.org/x/sys/unix in pkg/.
The syscall package has been deprecated in favor of golang.org/x/sys.

Note that syscall is still used in the following places:
- pkg/sentry/socket/hostinet/stack.go: some netlink related functionalities
  are not yet available in golang.org/x/sys.
- syscall.Stat_t is still used in some places because os.FileInfo.Sys() still
  returns it and not unix.Stat_t.

Updates #214

PiperOrigin-RevId: 360701387
2021-03-03 10:25:58 -08:00
Adin ScannellandgVisor bot 69f0412910 Remove existing nogo exceptions.
PiperOrigin-RevId: 347047550
2020-12-11 12:06:49 -08:00
Michael PrattandShentubot 4d52a55201 Change copyright notice to "The gVisor Authors"
Based on the guidelines at
https://opensource.google.com/docs/releasing/authors/.

1. $ rg -l "Google LLC" | xargs sed -i 's/Google LLC.*/The gVisor Authors./'
2. Manual fixup of "Google Inc" references.
3. Add AUTHORS file. Authors may request to be added to this file.
4. Point netstack AUTHORS to gVisor AUTHORS. Drop CONTRIBUTORS.

Fixes #209

PiperOrigin-RevId: 245823212
Change-Id: I64530b24ad021a7d683137459cafc510f5ee1de9
2019-04-29 14:26:23 -07:00
Ian GudgerandShentubot 8fce67af24 Use correct company name in copyright header
PiperOrigin-RevId: 217951017
Change-Id: Ie08bf6987f98467d07457bcf35b5f1ff6e43c035
2018-10-19 16:35:11 -07:00
Ian GudgerandShentubot a620bea045 Reduce map lookups in syserr
PiperOrigin-RevId: 208755352
Change-Id: Ia24630f452a4a42940ab73a8113a2fd5ea2cfca2
2018-08-14 19:03:38 -07:00
GooglerandAdin Scannell d02b74a5dc Check in gVisor.
PiperOrigin-RevId: 194583126
Change-Id: Ica1d8821a90f74e7e745962d71801c598c652463
2018-04-28 01:44:26 -04:00