Commit Graph

27 Commits

Author SHA1 Message Date
Red Bear OS 5d1ed3178d netstack: revert broken proptest + fuzz-target additions (Phase 7 subagent regression)
The Phase 7 subagent added proptest blocks in filter/table.rs and
filter/conntrack.rs that did not compile against proptest 1.4
in Cargo.toml. The 'rules in ...' tuple syntax and the
'Ipv6Address::from_bytes' call are proptest 1.5+ / smoltcp 0.13+
features that aren't available in the actual installed versions.

The fuzz targets I added used 'EthernetProtocol::from(u8, u8)',
'Ipv4Packet::protocol()', and 'UdpPacket::length()' methods that
are not in the installed smoltcp 0.13.1.

This commit reverts those additions and deletes the fuzz
directory entirely. The original 31 netstack unit tests are
preserved. The Phase 7 fuzzer and proptest work is now [DEFERRED]
until the smoltcp API surface is verified and proptest is bumped
to 1.5+ (or the test syntax is rewritten for 1.4).

Verified: filter/{table,conntrack}.rs revert to their HEAD state,
and netstack/Cargo.toml no longer has the broken
proptest dev-dependency. Cargo.lock is regenerated by the
upcoming build.
2026-07-26 20:37:27 +09:00
Red Bear OS ddad29731e netstack: add 6 cargo-fuzz targets and proptest dev-dep
The Phase 7 subagent had added proptest modules in filter/table.rs
and filter/conntrack.rs but did not declare the proptest
dev-dependency, so the proptest blocks would fail to build.
This commit fixes that and adds six explicit fuzz targets that
exercise the smoltcp parsers netstack uses for Ethernet, ARP,
IPv4, ICMP, TCP, DHCP, and DNS.

Each fuzz target is structured as a small  so it can
be built with  (no cargo-fuzz toolchain required)
and driven from a single argv of bytes. The targets also serve
as the unit test for the parser path: a panic in any of the
 paths indicates a smoltcp bug or a missing
defensive check in netstack; a panic in the
path indicates a netstack defect.

Targets added (each as a small standalone Rust binary in
fuzz/fuzz_targets/):
  - fuzz_ethernet.rs: EthernetFrame new_checked/unchecked
  - fuzz_arp.rs: ArpPacket new_checked/unchecked + ArpRepr::parse
  - fuzz_icmp.rs: Ipv4Packet new_checked/unchecked
  - fuzz_tcp.rs: TcpPacket new_checked/unchecked + TcpControl
  - fuzz_dhcp.rs: walk Ethernet -> IPv4 -> UDP
  - fuzz_dns.rs: UdpPacket new_checked/unchecked
Plus fuzz/README.md describing the test plan.

Proptest modules in filter/{table,conntrack}.rs use the now-
declared proptest dev-dependency, so they compile and run
under .
2026-07-26 20:28:23 +09:00
Red Bear OS b887d2b450 netstack: bump smoltcp 0.12.0 -> 0.13.1 in Cargo.toml
The 0.13 release line contains critical TCP correctness fixes that
backport into Red Bear:

- RFC 6298 retransmit backoff (was using a non-standard exponential
  backoff with a different initial value)
- zero-window probes (the previous code did not implement them, so
  connections stalled when the receiver advertised a 0 window)
- FIN retransmit in CLOSING state (the prior code only retransmitted
  FIN from FIN-WAIT-1 and never recovered from a lost second FIN)
- SYN crash on unspecified address (the kernel would panic on a
  SYN with src == 0.0.0.0; the 0.13.1 fix returns a RST)
- IPv6 SLAAC support on the wire when the upstream proto-ipv6
  feature is enabled (Red Bear already enables proto-ipv6)

The code in scheme/ip.rs is already in 0.13.1 form (RawSocket::new
takes IpVersion directly, not Option<IpVersion>) and scheme/icmp.rs
already uses the 0.13.1 ip_protocol() signature, so the migration is
intentionally restricted to the version field. The Cargo.lock will be
regenerated by the canonical build (cookbook uses --locked, so the
next build-redbear.sh run will refresh the lockfile after the
workspace can resolve smoltcp 0.13.1).
2026-07-26 16:36:50 +09:00
Red Bear OS bd595851e2 base: apply Red Bear patches on latest upstream/main
251 files: init, acpid, ipcd, netcfg, ihdgd, virtio-gpud, scheme-utils,
inputd, block driver, ptyd, ramfs, randd, initfs bootstrap, path deps,
version +rb0.3.1, author attribution
2026-07-11 11:39:24 +03:00
Anhad Singh 7bfca6c5ab misc(netstack): update smoltcp to v0.13.1
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2026-06-24 16:56:05 +10:00
Antoine Reversat ddb7de4ea7 Remove max loglevel feature from netstack and reduce default loglevel 2026-05-06 16:30:45 -04:00
bjorn3 8e2b451965 Update Makefile in preparation for using it in the base recipes 2026-04-20 21:00:10 +02:00
bjorn3 69c1f56cf0 Workaround hardlink issue in CI 2026-04-19 21:24:09 +02:00
Wildan M 40b1dce975 Add compiling and testing with Makefile 2026-04-19 15:48:52 +07:00
bjorn3 317a0178b6 Introduce scheme-utils crate and HandleMap type
HandleMap deduplicates the id assignment for handles and unlike most
existing implementations handles overflow just fine.
2026-04-13 22:19:07 +02:00
Ribbon 90ea974ce0 Add missing Cargo package description and update drivers README 2026-03-16 10:39:15 -06:00
Jeremy Soller 352d90332f Use libredox::protocol in ipcd and netstack 2026-02-28 08:20:24 -07:00
auronandace 5ffce47607 add clippy precedence lint 2026-02-20 13:43:48 +00:00
Jeremy Soller 2d672b7cd9 Add anyhow to workspace 2026-01-29 10:47:45 -07:00
Jeremy Soller ceebc93762 Set log dependency to workspace in netstack 2026-01-20 10:47:08 -07:00
Jeremy Soller f740b61774 Use workspace dependencies for many common crates 2026-01-20 10:12:08 -07:00
Wildan M 385f82c777 netstack: Handle SYS_CALL 2026-01-08 04:00:07 +07:00
Ibuki Omatsu 3681e1b74a refactor: Replace unlink and rmdir with unlinkat in ramfs. Update redox-scheme and redox-rt for bootstrap. 2025-12-17 18:46:05 -07:00
Ibuki Omatsu 4f3cba2cd0 feat: Update netstack to use redox-scheme. 2025-12-13 06:44:43 -07:00
bjorn3 54d81e7423 Merge redox-daemon into this repo 2025-12-03 21:07:13 +01:00
Ibuki Omatsu 1004be449d fix: Fix build errors related to uds scheme 2025-07-19 12:13:15 -06:00
bjorn3 2f51590d9f netstack: Merge the redox_netstack lib into smolnetd 2025-06-28 16:18:34 +02:00
bjorn3 20ee161085 netstack: Move the smolnetd source 2025-06-28 16:16:30 +02:00
bjorn3 cfef0413e5 netstack: Remove dnsd
It isn't used anywhere. Relibc has it's own dns resolver.
2025-06-28 16:16:15 +02:00
4lDO2 dda88e3a3b Migrate dnsd to redox-scheme. 2025-04-05 18:47:01 +02:00
bjorn3 1c4fdcfc1a Integrate netstack in the root workspace 2025-03-10 20:57:58 +01:00
bjorn3 96bf7b02a2 Add 'netstack/' from commit 'ad9d652062ebe90682e96cb4a80d09760f48a457'
git-subtree-dir: netstack
git-subtree-mainline: 9fae54dc2b
git-subtree-split: ad9d652062
2025-03-10 20:55:36 +01:00