371 Commits
Author SHA1 Message Date
Lucas ManningandgVisor bot 3a9ba17351 Fix device FD reference leaks and add support for VFIO_GROUP_UNSET_CONTAINER.
Fixes #11545

PiperOrigin-RevId: 739274186
2025-03-21 13:07:59 -07:00
Nicolas LacasseandgVisor bot 6b0a0af862 Implement basic packet mode support for ptys.
From man TIOCPKT:
"""
In packet mode, each subsequent read(2) will return a packet that either
contains a single nonzero control byte, or has a single byte containing zero
('\0') followed by data written on the slave side of the pseudoterminal."
"""

This CL implements only the data portion of packet mode, not the control bytes,
but that seems to be enough to get xfce4-terminal to work.

PiperOrigin-RevId: 737175092
2025-03-15 09:26:56 -07:00
Lucas ManningandgVisor bot faac8f36cd Add support for PACKET_STATISTICS.
PiperOrigin-RevId: 725271073
2025-02-10 10:46:54 -08:00
Lucas ManningandgVisor bot 9c490f813d Implement GetSockOpt PACKET_HDRLEN and add a test for tcpdump.
PiperOrigin-RevId: 724445536
2025-02-07 13:06:14 -08:00
Lucas ManningandgVisor bot 6194338723 Add support for setting PACKET_VERSION for PACKET_MMAP.
tcpdump requires TPACKET_V2 to work properly.

PiperOrigin-RevId: 723670574
2025-02-05 15:19:34 -08:00
Lucas ManningandgVisor bot 83a4caf2a7 Implement MappablePacketEndpoint for PACKET_MMAP and add tests.
PiperOrigin-RevId: 723590936
2025-02-05 11:39:27 -08:00
clickyotomy 4a8209f26f netfilter: Support multiport matching (-m multiport)
This set of changes adds:

  - support for `xt_multiport_{,v1}` matchers for matching for
    a range of ports and their inverse, i.e.,:

      ```
      -m multiport [!] --[s|d]ports (PORT,...|PORT:PORT,...)
      ```

  - support for `IP{,6}T_SO_GET_REVISION_MATCH` socket options,
    which allows `iptables` to query for the highest supported
    revision for a given matcher
2025-01-18 09:46:30 -05:00
Lucas ManningandgVisor bot 25b1d71341 Add constants and types related to the implementation of PACKET_MMAP.
This is the first in a series of changes that implements PACKET_MMAP.

PiperOrigin-RevId: 716014872
2025-01-15 17:45:19 -08:00
Ayush RanjanandgVisor bot ab9d8455d4 Re-use the same device file inode in tmpfs for overlay whiteout files.
When using overlayfs with tmpfs as the upper layer (common case), depending on
the application, a lot of whiteouts can be created. This leads to a lot of
memory allocation because new dentry and inode structs need to be allocated for
each whiteout. With this change, we at least avoid the inode allocations.

This is analogous with what Linux does. See fs/overlayfs/ovl_entry.h:ovl_fs's
field `whiteout` with comment "Shared whiteout cache".

PiperOrigin-RevId: 704897805
2024-12-10 17:11:22 -08:00
Andrei VaginandgVisor bot 03a28d158e platform/systrap: return memory access type based on a page fault error code
Now we don't need to trigger a second fault to figure out whether it was write
or read access.

Fixes #11008

Co-developed-by: Jamie Liu <jamieliu@google.com>
PiperOrigin-RevId: 697677262
2024-11-18 10:33:59 -08:00
Jamie LiuandgVisor bot cf5841ba66 mm: implement prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME)
PiperOrigin-RevId: 696727156
2024-11-14 19:06:07 -08:00
gVisor bot 079c1a937b Merge pull request #9551 from amysaq2023:support-external-stack
PiperOrigin-RevId: 677933413
2024-09-23 14:12:32 -07:00
Jayden NyamiakaandgVisor bot f366a27622 Add protocol family constants to netfilter uapi.
Added for use in nftables to match families to their defined constants.
Should have already been defined but it was just realized that families had
their own preset constants.
The actual values are needed for nftables implementation of meta operations.

PiperOrigin-RevId: 674364348
2024-09-13 11:19:37 -07:00
Lucas ManningandgVisor bot 290789bab8 Refactor tpu chroot operations.
Ubuntu TPU images do not have the vfio-dev directories that COS images do,
so we need a more robust way of setting up the sandbox chroot to handle this
case. This change implements a way to get devices and minor numbers into the
sandbox with minimal support from the host filesystem and cleans up a few
methods to reflect their current usage.

Addresses #10795

PiperOrigin-RevId: 674363342
2024-09-13 11:15:28 -07:00
Jayden NyamiakaandgVisor bot 0a43b7e4c2 Add netfilter meta operation constants for nftables support.
PiperOrigin-RevId: 674362689
2024-09-13 11:08:53 -07:00
Jayden NyamiakaandgVisor bot bc98f10dd3 Add netfilter byteorder operation constants for nftables support.
PiperOrigin-RevId: 673883678
2024-09-12 09:39:46 -07:00
Jayden NyamiakaandgVisor bot 9a61c0b3a2 Fix small bug in verdict constants where constants are ints instead of int32.
Prior, only the Continue verdict was an int32 while all the other verdict
constants were ints due to an early on misunderstanding of Golang. Easy fix.

PiperOrigin-RevId: 673606316
2024-09-11 17:54:45 -07:00
Jayden NyamiakaandgVisor bot f97dd13d1a Add netfilter route operation constants for nftables support.
PiperOrigin-RevId: 672671935
2024-09-09 14:22:57 -07:00
Jayden NyamiakaandgVisor bot 08e34478d3 Add netfilter range operation constants for nftables support.
PiperOrigin-RevId: 668041076
2024-08-27 10:25:32 -07:00
Jayden NyamiakaandgVisor bot 945b418c52 Add netfilter bitwise operation constants for nftables support.
PiperOrigin-RevId: 667902660
2024-08-27 02:34:24 -07:00
Jayden NyamiakaandgVisor bot f813cc6f7a Add netfilter payload expression constants for nftables support.
PiperOrigin-RevId: 662699475
2024-08-13 16:51:24 -07:00
Jayden NyamiakaandgVisor bot 3c98aab6f8 Add nf tables relational operator constants to use for Comparison operation.
PiperOrigin-RevId: 658544703
2024-08-01 14:47:57 -07:00
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 b66efac8c2 Fix standard priority constants to be consistent with Linux kernel equivalents.
Use NF_IP6_PRI_* constants instead of NF_IP4_PRI_* constants,
so they are the same as the constants defined in uapi/linux/netfilter_ipv6.h.

PiperOrigin-RevId: 653387765
2024-07-17 15:55:24 -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