Commit Graph
2183 Commits
Author SHA1 Message Date
Ayush RanjanandgVisor bot 8efec607d2 Additionally expect the custom tos/tclass in TOS_TCLASS_EXPECT_DEFAULT case.
PiperOrigin-RevId: 565458888
2023-09-14 13:25:12 -07:00
Ayush RanjanandgVisor bot 125b741d86 Return user_mss if user_mss is set and socket is unconnected.
Has the same effect as Linux commit 34dfde4ad87b ("tcp: Return user_mss for
TCP_MAXSEG in CLOSE/LISTEN state if user_mss set").

Updated test to accept both values (default and user set) so test works on
newer and older kernels.

PiperOrigin-RevId: 563844012
2023-09-08 13:57:42 -07:00
Lucas ManningandgVisor bot 33c1b3856d Fix debug builds.
This change also adds instructions for using a debugger with syscall tests.

Fixes #9039

PiperOrigin-RevId: 563576842
2023-09-07 16:28:00 -07:00
Jing ChenandgVisor bot 6cbd7dbd93 Let devices cgroup add/remove rules via devices.allow and devices.deny.
PiperOrigin-RevId: 563261158
2023-09-06 17:27:02 -07:00
Ghanan GowripalanandgVisor bot ce71f3cf3b Automated rollback of changelist 536743330
PiperOrigin-RevId: 563224104
2023-09-06 14:58:03 -07:00
gVisor bot a423565638 Merge pull request #9339 from kevinGC:tcsetsf2
PiperOrigin-RevId: 563207341
2023-09-06 13:58:08 -07:00
Jing ChenandgVisor bot 090d92a726 Have lgetxattr return ENODATA.
It is a workaround to lgetxattr/lsetxattr working with security.capacity when running docker in gvisor.

PiperOrigin-RevId: 563194162
2023-09-06 13:13:19 -07:00
gVisor bot faebee65d0 Merge pull request #9327 from kevinGC:benchmarkxdp
PiperOrigin-RevId: 563182220
2023-09-06 12:30:10 -07:00
Lucas ManningandgVisor bot 621c632afc A few fixes to run tests on 6.2+ kernels
* disable broken socket_inet_loopback test // Lucas Manning
* disable lseek tests on anon inodes. They have been broken by
commit e7478158e1378325907edfdd960eca98a1be405b
Date:   Wed Jun 29 15:06:57 2022 +0200
    fs: clear or set FMODE_LSEEK based on llseek function

* don't check memory.kmem.limit_in_bytes, it has been deprecated and dropped:
commit 86327e8eb94c52eca4f93cfece2e29d1bf52acbf
Date:   Tue Jul 4 13:52:40 2023 +0200
    memcg: drop kmem.limit_in_bytes
commit 58056f77502f3567b760c9a8fc8d2e9081515b2d
Date:   Fri Nov 5 13:37:44 2021 -0700
    memcg, kmem: further deprecate kmem.limit_in_bytes
commit 0158115f702b0ba208ab0b5adf44cae99b3ebcc7
Date:   Mon Sep 23 15:37:22 2019 -0700
    memcg, kmem: deprecate kmem.limit_in_bytes
PiperOrigin-RevId: 562915457
2023-09-05 15:51:21 -07:00
Kevin Krakauer dbbce69479 tty: enable TCSETSF
While there is a difference between flavors of this ioctl (`TCSETS`,
`TCSETSF`, `TCSETSW`), in practice it seems not to matter. We should let
users call `TCSETSF` and can implement those differences if necessary.
2023-09-05 09:53:50 -07:00
Kevin Krakauer 7c236fdb07 netstack: benchmark xdp endpoint
This just swaps out the fdbased endpoint for an XDP one. Some related
changes in here:

- Moved the AF_XDP BPF program into its own Go package so it can be
  shared.
- Added a flag to tcp_benchmark to disable user namespaces. This helps
  when running as root, which is required to install BPF programs.
2023-08-31 11:09:15 -07:00
Lucas ManningandgVisor bot cec42923e3 Clean up mount tests.
This change makes it simpler to write mount tests that examine the optional
field of mountinfo. It also cleans up the mounts in existing tests so they
don't pollute mountinfo after exit.

PiperOrigin-RevId: 561439839
2023-08-30 13:56:03 -07:00
Jing ChenandgVisor bot e3f7443b9b Support MS_STRICTATIME flag for the syscall mount.
PiperOrigin-RevId: 560207305
2023-08-25 15:17:23 -07:00
Shambhavi SrivastavaandgVisor bot 884e65cf41 Automated rollback of changelist 557871250
PiperOrigin-RevId: 560158129
2023-08-25 11:58:29 -07:00
Andrei VaginandgVisor bot e2fc34862a proc: add /proc/sys/kernel/cap_last_cap
PiperOrigin-RevId: 559932636
2023-08-24 18:29:31 -07:00
Etienne PerotandgVisor bot b703a2cb0a runsc metric-server: Move metric server to its own binary.
This creates a separate `go_binary` target for the metric server, and changes
the `runsc metric-server` subcommand to call it instead of directly executing
metric server code. This helps avoid Go library dependencies used only by the
metric server into the `runsc` binary.

PiperOrigin-RevId: 559221695
2023-08-22 14:19:15 -07:00
Jing ChenandgVisor bot 606462c738 Add device cgroup's devices.list, which defaults to allow all.
PiperOrigin-RevId: 558534572
2023-08-20 02:20:04 -07:00
Andrei VaginandgVisor bot 5262e552f8 vfs: Introduce the rootfs mount
The namespace root mount can't be changed, so let's mount a dummy
read-only tmpfs here. It simplifies creation of containers without
leaking the root file system.

PiperOrigin-RevId: 558301458
2023-08-18 18:56:09 -07:00
Zach KoopmansandgVisor bot f65ca898d2 Rearrange fio tests cases so regexs aren't ridiculous.
Rearrange benchmark function so calls in buildkite pipelines
are correct without 100 charecter regexes.

PiperOrigin-RevId: 558213872
2023-08-18 12:17:18 -07:00
Zach KoopmansandgVisor bot e51cab7e62 Fix redis test after new image is used.
Fix the redis test after the image has been changed. The new image has a
different output format, so update the report function to accomodate.
This also means we can collect more metrics easily.

Also use the redis-cli to check that the server is serving instead of
wget --spider.

PiperOrigin-RevId: 558181384
2023-08-18 10:22:59 -07:00
Lucas ManningandgVisor bot 94441a6e26 Fix small mount propagation bug.
The MS_PRIVATE flag was not being cleared in addPeer.

Reported-by: [email protected]
PiperOrigin-RevId: 557949154
2023-08-17 15:14:15 -07:00
Jing ChenandgVisor bot 9a79dec6f1 Implement SO_SNDTIMEO and SO_RCVTIMEO for netlink's setsockopt and getsockopt.
PiperOrigin-RevId: 557933811
2023-08-17 14:18:15 -07:00
Shambhavi SrivastavaandgVisor bot 76b2713c08 Adding /proc/[pid]/task/[tid]/children
PiperOrigin-RevId: 557888186
2023-08-17 11:41:48 -07:00
Lucas ManningandgVisor bot 586bf2016a Fix the delay-for-debugger flag so that it reports test failures.
The wait command will always return 0 even if the underlying process
returns a different exit code. It prints out the exit code of the process
to its stdout as json.

PiperOrigin-RevId: 557877257
2023-08-17 11:07:39 -07:00
Nicolas LacasseandgVisor bot 5dc1f9fa34 Automated rollback of changelist 554554034
PiperOrigin-RevId: 557871250
2023-08-17 10:50:10 -07:00
Jeff MartinandgVisor bot 54a6be0000 Internal change.
PiperOrigin-RevId: 556842126
2023-08-14 10:45:30 -07:00
Jing ChenandgVisor bot 6e7a49f314 Add missing device cgroups.
PiperOrigin-RevId: 556053561
2023-08-11 12:48:03 -07:00
Fangrui SongandgVisor bot 0fafb2be8a Align buffer for cmsg
`char control[CMSG_SPACE(sizeof(*out_cmsg_value)) + 1];` is not aligned as
cmsghdr. Accessing its member may lead to a -fsanitize=alignment failure.
Align `control` to struct cmsghdr to fix the issue.

PiperOrigin-RevId: 555951052
2023-08-11 07:54:10 -07:00
Nayana BidariandgVisor bot eba9311640 Make changes for CgroupsReadControlFile method to get memory usage per cgroup.
- Adds methods to Enter, Leave and Migrate the tasks for memory controller.
- Update the memory cgroup id when the task enters and leaves the cgroups.

PiperOrigin-RevId: 555568875
2023-08-10 11:09:28 -07:00
Jeff MartinandgVisor bot fc414d1147 Add test coverage for RTM_GETRULE, RTM_ADDRULE, and RTM_DELRULE
PiperOrigin-RevId: 554806910
2023-08-08 06:43:27 -07:00
Jeff MartinandgVisor bot 70b723d06c Add test coverage for RTM_NEWROUTE & RTM_DELROUTE
PiperOrigin-RevId: 554612706
2023-08-07 15:37:13 -07:00
Jeff MartinandgVisor bot ae03bdb1be Internal change.
PiperOrigin-RevId: 554591336
2023-08-07 14:22:55 -07:00
Ayush RanjanandgVisor bot 4aa6b5b692 Add generic tooling to scrape output from fastlane ruby test suite.
PiperOrigin-RevId: 554562254
2023-08-07 12:49:30 -07:00
Shambhavi SrivastavaandgVisor bot f75fcdfa83 Implementing clone3
Updates #8585

PiperOrigin-RevId: 554554034
2023-08-07 12:19:32 -07:00
Jing ChenandgVisor bot 906efa4976 Implement setns CLONE_NEWUTS namespace type.
PiperOrigin-RevId: 554306089
2023-08-06 15:33:25 -07:00
Andrei VaginandgVisor bot 4af420d420 Implement setns for mount namespaces
PiperOrigin-RevId: 552859231
2023-08-01 11:12:29 -07:00
Jing ChenandgVisor bot 4e5d1c16a5 Add devices cgroups which is partially implemented. It could export the device cgroups to devices.deny and devices.allow, add/remove device cgroups rules will need to be implemented to fully support device cgroups.
PiperOrigin-RevId: 552673967
2023-07-31 21:22:07 -07:00
Andrei VaginandgVisor bot 4d39b66860 Implement mount namespaces
This change implements only the basic functions of mount namespaces.
All features that depends on user namespaces will be implemented separately.

PiperOrigin-RevId: 552673896
2023-07-31 21:12:21 -07:00
Jing ChenandgVisor bot a595c26bfe Implement setns CLONE_NEWIPC namespace type.
PiperOrigin-RevId: 552619565
2023-07-31 16:12:45 -07:00
Ayush RanjanandgVisor bot ecf8bfa3cc Exclude internet/test-inspector-help-page.js nodejs runtime test.
This test fails with runc too. Seems like it is broken.

PiperOrigin-RevId: 552575861
2023-07-31 13:28:50 -07:00
Etienne PerotandgVisor bot be5373de33 gVisor fio benchmarks: Use libaio where it makes sense.
Enforce that `IODepth` must be `1` when using the `sync` IO engine, since
it has no effect with that engine.

Also add unit names to `tools.Fio` struct fields for easier readability.

PiperOrigin-RevId: 550710273
2023-07-24 16:48:03 -07:00
Andrei VaginandgVisor bot c5493106c6 Implement the setns syscall
This change introduces the nsfs file system. Each new namespace allocates
a new nsfs inode.

Here are reasons why we need these inodes:
* each namespace has to have an unique id.
* proc/pid/ns/ contains one entry for each namespace. Bind mounting one of
  the files in this directory to somewhere else in the filesystem keeps the
  corresponding namespace alive even if all processes currently in
  the namespace terminate.
* setns() allows the calling process to join an existing namespace specified
  by a file descriptor.

PiperOrigin-RevId: 550694515
2023-07-24 15:45:08 -07:00
Etienne PerotandgVisor bot 11278a7cf6 Add O_DIRECT version of fio benchmarks to track direct I/O performance.
PiperOrigin-RevId: 549470615
2023-07-19 17:27:02 -07:00
Ayush RanjanandgVisor bot 5c781c9ca4 Allow walking on FIFO and UDS in lisafs.
The flags --host-uds and --host-fifo only control whether the application can
open/connect or create/bind these special files. Stat-ing a host FIFO or UDS
should not be blocked.

PiperOrigin-RevId: 549199286
2023-07-18 21:53:21 -07:00
Nicolas LacasseandgVisor bot 6733665148 Implement PR_{S,G}ET_CHILD_SUBREAPER.
Closes #2323

PiperOrigin-RevId: 548205854
2023-07-14 13:19:25 -07:00
Kevin KrakauerandgVisor bot d53c3588f0 netstack: remove finished TODO
Fixes #6015.

PiperOrigin-RevId: 548191467
2023-07-14 12:23:58 -07:00
Etienne PerotandgVisor bot c095565dd8 fio benchmark: Do not call fallocate in read-only benchmarks.
Calling `fallocate` is not a typical operation for an application to do when
it is only trying to read a file.

This has performance implications for gVisor, so we override `fio`'s default
behavior for read-only benchmarks to be more representative of real-world
read-only performance.

PiperOrigin-RevId: 547912572
2023-07-13 14:00:59 -07:00
gVisor bot b4d5243dbc Merge pull request #7356 from turekt:pollrdhup-fix
PiperOrigin-RevId: 547867839
2023-07-13 11:39:30 -07:00
Jing ChenandgVisor bot e3e28b24d1 Allow fchown to change the ownership of a pipe file descriptor.
PiperOrigin-RevId: 547636998
2023-07-12 16:50:25 -07:00
Nayana BidariandgVisor bot 920bee37b7 Test to check setting IPV6_V6ONLY on datagram socket with IPV4 address fails.
PiperOrigin-RevId: 546955039
2023-07-10 12:58:50 -07:00