summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)Author
2021-09-15Merge release-20210906.0-29-ga8ad692fd (automated)gVisor bot
2021-09-15Annotate checklocks on mutex protected fieldsGhanan Gowripalan
...to catch lock-related bugs in nogo tests. This change also disables/enables packet reception before/after save/restore with a flag that is protected by rcvMu instead of mu. Updates #6566. PiperOrigin-RevId: 396946187
2021-09-15Merge pull request #6581 from prattmic:runsc_rootlessgVisor bot
PiperOrigin-RevId: 396938550
2021-09-15Merge release-20210906.0-26-g8b56b6b83 (automated)gVisor bot
2021-09-15Pass address properties in a single structTony Gong
Replaced the current AddAddressWithOptions method with AddAddressWithProperties which passes all address properties in a single AddressProperties type. More properties that need to be configured in the future are expected, so adding a type makes adding them easier. PiperOrigin-RevId: 396930729
2021-09-15Merge release-20210906.0-25-g149ca0096 (automated)gVisor bot
2021-09-15[bind] Return EINVAL for under sized addressGhanan Gowripalan
...and EAFNOSUPPORT for unexpected address family. To comply with Linux. Updates #6021, #6575. PiperOrigin-RevId: 396893590
2021-09-15Merge release-20210906.0-24-g2d9883e4f (automated)gVisor bot
2021-09-14Remove extra newlineMichael Pratt
PiperOrigin-RevId: 396754242
2021-09-15Merge release-20210906.0-23-g0bec34a8e (automated)gVisor bot
2021-09-14Compose raw IP with datagram-based endpointGhanan Gowripalan
A raw IP endpoint's write and socket option get/set path can use the datagram-based endpoint. This change extracts tests from UDP that may also run on Raw IP sockets. Updates #6565. Test: Raw IP + datagram-based socket syscall tests. PiperOrigin-RevId: 396729727
2021-09-15Merge release-20210906.0-22-g39470428d (automated)gVisor bot
2021-09-14Use a shared method to get loopback indexGhanan Gowripalan
Code to get the loopback interface's index is scattered throughout the syscall tests. Implement the code once and use that in tests (where applicable). While I am here, trim the dependencies/includes for network namespace tests. PiperOrigin-RevId: 396718124
2021-09-14Fix race on msgrcv(MSG_COPY).Rahat Mahmood
Previously, we weren't making a copy when a sysv message queue was receiving a message with the MSG_COPY flag. This flag indicates the message being received should be left in the queue and a copy of the message should be returned to userspace. Without the copy, a racing process can modify the original message while it's being marshalled to user memory. Reported-by: syzbot+cb15e644698b20ff4e17@syzkaller.appspotmail.com PiperOrigin-RevId: 396712856
2021-09-14Merge release-20210906.0-20-g8d14edb14 (automated)gVisor bot
2021-09-14Explicitly bind endpoint to a NICGhanan Gowripalan
Previously, any time a datagram-based network endpoint (e.g. UDP) was bound, the bound NIC is always set based on the bound address (if specified). However, we should only consider the endpoint bound to an NIC if a NIC was explicitly bound to. If an endpoint has been bound to an address and attempts to send packets to an unconnected remote, the endpoint will default to sending packets through the bound address' NIC if not explicitly bound to a NIC. Updates #6565. PiperOrigin-RevId: 396712415
2021-09-14Merge release-20210906.0-17-g2b46e2d19 (automated)gVisor bot
2021-09-14Merge release-20210906.0-19-g603f473ad (automated)gVisor bot
2021-09-14Fix bug in RecvMMsgDispatcher.Bhasker Hariharan
Fixed a bug introduced in the following commit: https://github.com/google/gvisor/commit/979d6e7d77b17e94defc29515180cc75d3560383 The commit introduced a bug which causes the recvmmsg dispatcher to never exit as BlockingPoll is now called with two fds and poll will not return an error anymore if one of the FD is closed. We need to explicitly check the events for each FD to determine if the sentry FD is closed. ReadV dispatcher does not have the same issue as Readv does not rely on sk_err field of the underlying socket to determine if the socket is in an error state. Recvmmsg OTOH seems to get confused and always returns EAGAIN if poll() is called which queries the sk_err field and clears it. PiperOrigin-RevId: 396676135
2021-09-14Merge release-20210906.0-18-g5593b8a7e (automated)gVisor bot
2021-09-14Don't use SOL_UDP when creating socketsGhanan Gowripalan
SOL_UDP is used when get/set-ing socket options to specify the socket level. When creating normal UDP sockets, the protocol need not be specified. When creating RAW IP sockets for UDP, use IPPROTO_UDP. PiperOrigin-RevId: 396675986
2021-09-14Defer mutex unlockingGhanan Gowripalan
PiperOrigin-RevId: 396670516
2021-09-14runsc: allow rootless mode for runsc runMichael Pratt
Rootless mode seems to work fine for simple containers with runsc run, so allow its use. Since runsc run is more widely used, require a workable --network option is passed rather than automatically switching like runsc do does. Fixes #3036
2021-09-14Merge release-20210906.0-16-g226e7d32c (automated)gVisor bot
2021-09-13Accept packets destined to bound addressGhanan Gowripalan
...if bound to an address. We previously checked the source of a packet instead of the destination of a packet when bound to an address. PiperOrigin-RevId: 396497647
2021-09-14Merge release-20210906.0-15-g4795e0835 (automated)gVisor bot
2021-09-13Typo fix.Etienne Perot
PiperOrigin-RevId: 396476303
2021-09-13Merge release-20210906.0-14-g95fe4fea1 (automated)gVisor bot
2021-09-13tools/show_paths.bzl: check that provider_map isn't NoneAndrei Vagin
Otherwise it can fail: $ bazel cquery pkg/p9/... --output=starlark --starlark:file=tools/show_paths.bzl ... ERROR: Starlark evaluation error for //pkg/p9/p9test:mockgen: Traceback (most recent call last): File "tools/show_paths.bzl", line 8, column 32, in format Error: 'NoneType' value has no field or method 'get' PiperOrigin-RevId: 396457764
2021-09-13Merge release-20210906.0-13-ge07fd058e (automated)gVisor bot
2021-09-13Set NICID before delivering packet to raw endpointGhanan Gowripalan
...as raw endpoints expect the packet's NICID to be set. PiperOrigin-RevId: 396446552
2021-09-13Merge release-20210830.0-35-g79834ce16 (automated)gVisor bot
2021-09-13Separate IPv4 ToS & IPv6 TClass in dgram endpointGhanan Gowripalan
Setting the ToS for IPv4 packets (SOL_IP, IP_TOS) should not affect the Traffic Class of IPv6 packets (SOL_IPV6, IPV6_TCLASS). Also only return the ToS value XOR Traffic Class as a packet cannot be both an IPv4 and an IPv6 packet; It is invalid to return both the IPv4 ToS and IPv6 Traffic Class control messages when reading packets. Updates #6389. PiperOrigin-RevId: 396399096
2021-09-13Merge release-20210830.0-34-g6bcacb2fd (automated)gVisor bot
2021-09-13Support anonymous structs in checklocks.Adin Scannell
Fixes #6558 PiperOrigin-RevId: 396393293
2021-09-12Merge release-20210830.0-33-g63b1c736b (automated)gVisor bot
2021-09-11Internal change.gVisor bot
PiperOrigin-RevId: 396155387
2021-09-11Merge release-20210830.0-32-g28853599c (automated)gVisor bot
2021-09-10Typo fix.Etienne Perot
PiperOrigin-RevId: 396042572
2021-09-10Merge release-20210830.0-31-g7da9bb18c (automated)gVisor bot
2021-09-09Use accessor for runsc ControlConfig proto.Rahat Mahmood
PiperOrigin-RevId: 395859347
2021-09-10Merge release-20210830.0-30-g2572af388 (automated)gVisor bot
2021-09-09Remove linux-compat loopback hacks from packet endpointGhanan Gowripalan
Previously, gVisor did not represent loopback devices as an ethernet device as Linux does. To maintain Linux API compatibility for packet sockets, a workaround was used to add an ethernet header if a link header was not already present in the packet buffer delivered to a packet endpoint. However, this workaround is a bug for non-ethernet based interfaces; not all links use an ethernet header (e.g. pure L3/TUN interfaces). As of 3b4bb947517d0d9010120aaa1c3989fd6abf278e, gVisor represents loopback devices as an ethernet-based device so this workaround can now be removed. BUG: https://fxbug.dev/81592 Updates #6530, #6531. PiperOrigin-RevId: 395819151
2021-09-09Merge release-20210830.0-29-g833d933af (automated)gVisor bot
2021-09-09Internal change.Jamie Liu
PiperOrigin-RevId: 395809193
2021-09-09Remove link/packetsocketGhanan Gowripalan
This change removes NetworkDispatcher.DeliverOutboundPacket. Since all packet writes go through the NIC (the only NetworkDispatcher), we can deliver outgoing packets to interested packet endpoints before writing the packet to the link endpoint as the stack expects that all packets that get delivered to a link endpoint are transmitted on the wire. That is, link endpoints no longer need to let the stack know when it writes a packet as the stack already knows about the packet it writes through a link endpoint. PiperOrigin-RevId: 395761629
2021-09-09Merge release-20210830.0-27-g5e9c3a0b9 (automated)gVisor bot
2021-09-09Add EthernetHeader only if underlying NIC has a mac address.Bhasker Hariharan
Fixes #6532 PiperOrigin-RevId: 395741741
2021-09-07Stub some memory control files.Rahat Mahmood
PiperOrigin-RevId: 395338926
2021-09-07Merge release-20210830.0-25-g2f2fb3813 (automated)gVisor bot