10 Commits
Author SHA1 Message Date
Ayush RanjanandgVisor bot 7a918a4292 Chunkify p{read/write}v in hostfd package.
Instead of truncating iovecs when len(iovecs) > MaxReadWriteIov, we should
attempt a full write. There are multiple users of hostfd:
- tmpfs (when using file backend)
- gofer client
- hostinet
- fsimpl/host

These callers use hostfd to implement all read/write operations. Even though
read/write syscall semantics allow for short IO, Linux seems to be doing full
reads/writes. For compatibility, hostfd should attempt full IO.

PiperOrigin-RevId: 582050290
2023-11-13 12:34:34 -08:00
Ayush RanjanandgVisor bot f62a4a77d5 Update go branch to Go 1.21.
Starting with Go 1.21, build tags select the language version. We currently
have several `go:build go1.1` tags, which were intended to act as "true" tags.
But that will break with 1.21. So replace them with "!false".

Fixes #9568.

PiperOrigin-RevId: 576020779
2023-10-23 22:09:47 -07:00
Adin ScannellandgVisor bot 1ceb814544 Add default_applicable_licenses rules to packages.
PiperOrigin-RevId: 513581243
2023-03-02 10:50:04 -08:00
Kevin KrakauerandgVisor bot d8aa09e04c convert uses of interface{} to any
Done via:
  find . -name "*.go" | xargs sed -i -E 's/interface\{\}/any/g'

PiperOrigin-RevId: 487033228
2022-11-08 13:14:06 -08:00
Jamie LiuandgVisor bot 1ad3822200 Add go:build directives as required by Go 1.17's gofmt.
PiperOrigin-RevId: 385894869
2021-07-20 16:28:45 -07:00
Jamie LiuandgVisor bot ccd2d607e5 Internal change.
PiperOrigin-RevId: 381375705
2021-06-24 18:03:15 -07:00
Ayush RanjanandgVisor bot a9441aea27 [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
Jamie LiuandgVisor bot 29683f3598 Cap iovec array length in //pkg/sentry/hostfd.
PiperOrigin-RevId: 341001328
2020-11-06 00:20:35 -08:00
Nicolas LacasseandgVisor bot c52195d258 Stop avoiding preadv2 and pwritev2, and add them to the filters.
Some code paths needed these syscalls anyways, so they should be included in
the filters. Given that we depend on these syscalls in some cases, there's no
real reason to avoid them any more.

PiperOrigin-RevId: 310829126
2020-05-10 17:52:20 -07:00
Jamie LiuandgVisor bot e0c67014cb Factor fsimpl/gofer.host{Preadv,Pwritev} out of fsimpl/gofer.
Also fix returning EOF when 0 bytes are read.

PiperOrigin-RevId: 308089875
2020-04-23 11:08:24 -07:00