aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/flatrpc/conn_test.go
Commit message (Collapse)AuthorAgeFilesLines
* pkg/rpcserver: pkg/flatrpc: executor: add handshake stage 0Alexander Potapenko2025-02-201-2/+27
| | | | | | | | | | | | | | | | | | | | As we figured out in #5805, syz-manager treats random incoming RPC connections as trusted, and will crash if a non-executor client sends an invalid packet to it. To address this issue, we introduce another stage of handshake, which includes a cookie exchange: - upon connection from an executor, the manager sends a ConnectHello RPC message to it, which contains a random 64-bit cookie; - the executor calculates a hash of that cookie and includes it into its ConnectRequest together with the other information; - before checking the validity of ConnectRequest, the manager ensures client sanity (passed ID didn't change, hashed cookie has the expected value) We deliberately pick a random cookie instead of a magic number: if the fuzzer somehow learns to send packets to the manager, we don't want it to crash multiple managers on the same machine.
* pkg/rpcserver: refactor to remove Fatalf callsAleksandr Nogikh2025-01-291-43/+61
| | | | Apply necessary changes to pkg/flatrpc and pkg/manager as well.
* executor: query globs in the test program contextDmitry Vyukov2024-12-111-2/+0
| | | | | | | | | | | | | | | | | We query globs for 2 reasons: 1. Expand glob types in syscall descriptions. 2. Dynamic file probing for automatic descriptions generation. In both of these contexts are are interested in files that will be present during test program execution (rather than normal unsandboxed execution). For example, some files may not be accessible to test programs after pivot root. On the other hand, we create and link some additional files for the test program that don't normally exist. Add a new request type for querying of globs that are executed in the test program context.
* pkg/rpcserver: use dense VM indices instead of string namesDmitry Vyukov2024-08-021-2/+2
| | | | | | Using actual VM indices for VM identification allows to match these indices to VMs in the pool, allows to use dense arrays to store information about runners (e.g. in queue.Distributor), and just removes string names as unnecessary additional entities.
* pkg/flatrpc: verify executor messages betterDmitry Vyukov2024-07-111-1/+31
| | | | | This should prevent possible OOM kills. See the added comment for details.
* executor: add runner modeDmitry Vyukov2024-06-241-16/+51
| | | | | | | Move all syz-fuzzer logic into syz-executor and remove syz-fuzzer. Also restore syz-runtest functionality in the manager. Update #4917 (sets most signal handlers to SIG_IGN)
* pkg/flatrpc: refactor namesDmitry Vyukov2024-05-061-13/+13
| | | | | | | | | | Remove T suffix from object API types. It seems that we will use these types thoughout the code, and the suffix looks alien in Go code. So it's better to remove it before we started using these names more widely. Also add few extensions we will need to move feature checking to the host.
* pkg/flatrpc: add connection typeDmitry Vyukov2024-05-031-0/+142
Add server/client connection wrapper that allows sending/receiving flatbuffers RPC messages.