62 Commits
Author SHA1 Message Date
Jayden NyamiakaandgVisor bot ed73825c69 Add nf table register and internal verdict constants to support nf table rules.
PiperOrigin-RevId: 656420112
2024-07-26 09:04:42 -07:00
Jayden NyamiakaandgVisor bot 410cb04f2d Add netfilter hook priority constants for nftables support.
PiperOrigin-RevId: 652945259
2024-07-16 12:55:06 -07:00
Jing ChenandgVisor bot 628f1bad34 Implement the ioctl command VFIO_DEVICE_SET_IRQS.
PiperOrigin-RevId: 618047305
2024-03-21 20:43:12 -07:00
Jing ChenandgVisor bot 73f7d3d3f7 Implement ioctl command VFIO_GROUP_SET_CONTAINER.
PiperOrigin-RevId: 615514857
2024-03-13 12:57:32 -07:00
Etienne PerotandgVisor bot 181a57866a Add ABI for keyctl(2).
PiperOrigin-RevId: 566711348
2023-09-19 12:37:33 -07:00
Adin ScannellandgVisor bot 1ceb814544 Add default_applicable_licenses rules to packages.
PiperOrigin-RevId: 513581243
2023-03-02 10:50:04 -08:00
Adin ScannellandgVisor bot bd561fd3f9 Move from facts render to facts validation.
This allows fact information to be validated in the underlying source files,
but requires us to explicitly maintain this in appropriate version-tagged, and
architecture-tagged files. This is more explicit and safer.

This mechanism uses a special regular expression for matching a +checkconst
stanza to validate constant values, sizes and offsets. This applies to both Go
source files and assembly files.

PiperOrigin-RevId: 511867507
2023-02-23 13:17:49 -08:00
Adin ScannellandgVisor bot 6a4908b262 Process nogo targets across all architectures.
PiperOrigin-RevId: 511343590
2023-02-21 17:06:02 -08:00
Andrei VaginandgVisor bot ff8aa35e1c Dynamically determine the address space size
PiperOrigin-RevId: 501362170
2023-01-11 13:23:34 -08:00
Adin ScannellandgVisor bot 2928c19239 Move to code generation rather than reflection for io_uring offsets.
This avoids the cost at startup time and allows the resulting function to
be more effectively inlined to call sites. Although these are not widely
used at the moment, this change may also be used as an example for code
generation in similar cases.

PiperOrigin-RevId: 477597333
2022-09-28 17:53:21 -07:00
Sergey MadaminovandgVisor bot 31d8668e51 Pseudo-filesystem iouringfs for IO_URING.
Similar to Linux, we should add pseudo-filesystem iouringfs in gVisor to back
IO_URING's file descriptors. We start with stubbing `io_uring_setup(2)` so it
provides a file descriptor backed by anonfs.

PiperOrigin-RevId: 473384042
2022-09-09 18:09:29 -07:00
Zyad A. Ali 4fdfb178e7 Add abi definitions for POSIX message queues.
Updates #136
2021-09-15 21:56:35 +02:00
Zyad A. Ali 44c8766d2e Add abi definitions for sysv message queues.
Updates #135
2021-07-13 22:12:02 +02:00
Zach KoopmansandgVisor bot 63b4f6e296 [syserror] Refactor linuxerr and error package.
Move Error struct to pkg/errors package for use in multiple places.
Move linuxerr static definitions under pkg/errors/linuxerr.
Add a lookup list for quick lookup of *errors.Error by errno. This is useful
when converting syserror errors and unix.Errno/syscall.Errrno values to
*errors.Error.
Update benchmarks routines to include conversions.

The below benchmarks show *errors.Error usage to be comparable to using
unix.Errno.

BenchmarkAssignUnix
BenchmarkAssignUnix-32                 	787875022	         1.284 ns/op
BenchmarkAssignLinuxerr
BenchmarkAssignLinuxerr-32             	1000000000	         1.209 ns/op
BenchmarkAssignSyserror
BenchmarkAssignSyserror-32             	759269229	         1.429 ns/op
BenchmarkCompareUnix
BenchmarkCompareUnix-32                	1000000000	         1.310 ns/op
BenchmarkCompareLinuxerr
BenchmarkCompareLinuxerr-32            	1000000000	         1.241 ns/op
BenchmarkCompareSyserror
BenchmarkCompareSyserror-32            	147196165	         8.248 ns/op
BenchmarkSwitchUnix
BenchmarkSwitchUnix-32                 	373233556	         3.664 ns/op
BenchmarkSwitchLinuxerr
BenchmarkSwitchLinuxerr-32             	476323929	         3.294 ns/op
BenchmarkSwitchSyserror
BenchmarkSwitchSyserror-32             	39293408	        29.62 ns/op
BenchmarkReturnUnix
BenchmarkReturnUnix-32                 	1000000000	         0.5042 ns/op
BenchmarkReturnLinuxerr
BenchmarkReturnLinuxerr-32             	1000000000	         0.8152 ns/op
BenchmarkConvertUnixLinuxerr
BenchmarkConvertUnixLinuxerr-32        	739948875	         1.547 ns/op
BenchmarkConvertUnixLinuxerrZero
BenchmarkConvertUnixLinuxerrZero-32    	977733974	         1.489 ns/op

PiperOrigin-RevId: 379806801
2021-06-16 14:08:52 -07:00
Ayush RanjanandgVisor bot a51fcf22eb [op] Move SignalStack to abi/linux package.
Updates #214

PiperOrigin-RevId: 378594929
2021-06-10 01:00:24 -07:00
Ian LewisandgVisor bot 2bed0bb096 Send SIGPIPE for closed pipes.
Fixes #5974
Updates #161

PiperOrigin-RevId: 375024740
2021-05-20 23:44:41 -07:00
Zach KoopmansandgVisor bot 49eb3da98a [syserror] Refactor abi/linux.Errno
PiperOrigin-RevId: 373265454
2021-05-11 17:23:08 -07:00
Rahat MahmoodandgVisor bot e00bd82816 Remove uses of the binary package from the rest of the sentry.
PiperOrigin-RevId: 372020696
2021-05-04 16:41:08 -07:00
Ayush RanjanandgVisor bot cfa4633c3d [go-marshal] Add dynamic tag in go_marshal.
This makes it easier to implement dynamically sized types in go-marshal. You
really only need to implement MarshalBytes, UnmarshalBytes and SizeBytes to
implement the entire interface.

By using the `dynamic` tag, the autogenerator will generate the rest of the
methods for us.

This change also simplifies how KernelIPTGetEntries implements Marshallable
using the newly added utility.

PiperOrigin-RevId: 356397114
2021-02-08 18:08:29 -08:00
Ayush RanjanandgVisor bot 74788b1b61 [netstack] Implement MSG_ERRQUEUE flag for recvmsg(2).
Introduces the per-socket error queue and the necessary cmsg mechanisms.

PiperOrigin-RevId: 348028508
2020-12-17 08:47:24 -08:00
Jing ChenandNicolas Lacasse e5c1b035ab Introduce SemidDs struct for amd64 and arm64.
PiperOrigin-RevId: 338756277
2020-10-23 16:12:12 -07:00
Jamie LiuandgVisor bot 1336af78d5 Implement membarrier(2) commands other than *_SYNC_CORE.
Updates #267

PiperOrigin-RevId: 335713923
2020-10-06 13:55:16 -07:00
Rahat MahmoodandgVisor bot 3ca73841d7 Move the 'marshal' and 'primitive' packages to the 'pkg' directory.
PiperOrigin-RevId: 331256608
2020-09-11 17:42:49 -07:00
Kevin KrakauerandgVisor bot d50f2e2c76 ip6tables: ABI structs and constants
Part of #3549.

PiperOrigin-RevId: 326329028
2020-08-12 16:20:51 -07:00
Ridwan SharifandgVisor bot 112eb0c5b9 Add device implementation for /dev/fuse
This PR adds the following:
  - [x] Marshall-able structs for fuse headers
  - [x] Data structures needed in /dev/fuse to communicate with the daemon server
  - [x] Implementation of the device interface
  - [x] Go unit tests

This change adds the `/dev/fuse` implementation. `Connection` controls the
communication between the server and the sentry.  The FUSE server uses
the `FileDescription` interface to interact with the Sentry. The Sentry
implmenetation of fusefs, uses `Connection` and the Connection interface
to interact with the Server. All communication messages are in the form
of `go_marshal` backed structs defined in the ABI package.

This change also adds some go unit tests that test (pretty basically)
the interfaces and should be used as an example of an end to end FUSE
operation.

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/gvisor/pull/3083 from ridwanmsharif:ridwanmsharif/fuse-device-impl 69aa2ce970004938fe9f918168dfe57636ab856e
PiperOrigin-RevId: 323428180
2020-07-27 13:34:44 -07:00