1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
| | #!/bin/sh
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
# fuzzing/fuzz-setup.sh - Rootless network namespace for AFL++ fuzzing
#
# Creates a user + network namespace (no root required) with AnyIP
# routing so the test server intercepts all outbound TCP connections
# from passt, regardless of destination IP/port or address family.
#
# Usage:
# fuzzing/fuzz-setup.sh -- afl-fuzz [opts] -- ./passt.fuzz --foreground
#
# Copyright Red Hat
# Author: Anshu Kumari <anskuma@redhat.com>
exec unshare --map-root-user --net -- sh -c '
set -e
ip link set lo up
ip route add local 0.0.0.0/0 dev lo
ip -6 route add local ::/0 dev lo
exec "$@"
' _ "$@"
|