Page MenuHomeFreeBSD

debugnet(4): Infer non-server connection parameters
ClosedPublic

Authored by cem on Sep 1 2019, 8:38 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 17, 7:46 PM
Unknown Object (File)
Sat, Apr 6, 3:15 AM
Unknown Object (File)
Feb 23 2024, 9:02 AM
Unknown Object (File)
Feb 19 2024, 4:05 PM
Unknown Object (File)
Jan 17 2024, 1:35 AM
Unknown Object (File)
Jan 8 2024, 11:52 PM
Unknown Object (File)
Dec 25 2023, 6:17 PM
Unknown Object (File)
Dec 20 2023, 4:49 AM
Subscribers

Details

Summary

Loosen requirements for connecting to debugnet-type servers. Only require a
destination address; the rest can theoretically be inferred from the routing
table. (If the routing table is potentially damaged, one can always specify
the parameters explicitly with the same option flags as before.

Relax corresponding constraints in netdump(4) and move ifp validation to
debugnet connection time.

Submitted by: John Reimer <john.reimer AT emc.com> (earlier version)

Test Plan
testvm# sysctl debug.kdb.panic=1
debug.kdb.panic:panic: kdb_sysctl_panic
...
KDB: enter: panic
[ thread pid 697 tid 100102 ]
Stopped at      kdb_enter.part.5+0x27:  movq    $0,0x139348e(%rip)
db> netdump -s x.y.z.d debugnet: overwriting mbuf zone pointers
debugnet_connect: Destination address is on link.
debugnet_connect: Connecting to x.y.z.d:20023 from a.b.c.d:20024 on vtnet0
debugnet_connect: searching for server MAC...
debugnet_handle_arp: got server MAC address aa:bb:cc:dd:ee:ff
netdumping to x.y.z.d (aa:bb:cc:dd:ee:ff)
Dumping 96 out of 475 MB:..17% ..34%..50%..67% ..84%..100%
netdump finished.
debugnet: restoring mbuf zone pointers

Dump complete

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 26266
Build 24754: arc lint + arc unit

Event Timeline

Rebase on lexer API change.

sys/netinet/netdump/netdump_client.c
414

This check doesn't really make sense for a DDB-invoked netdump. The panicking thread may well be in a non-default vnet, in which case we should switch to vnet0 for the purpose of the lookup, like you do for the routing table lookup above. For configuration coming from dumpon I think it still makes sense for now to reject the request when running in vnet0.

cem marked an inline comment as done.Sep 10 2019, 5:20 AM
cem added inline comments.
sys/netinet/netdump/netdump_client.c
414

Let's discuss on D21460 instead.

sys/netinet/netdump/netdump_client.c
414

For posterity: I meant to write "when _not_ running in vnet0."

This revision is now accepted and ready to land.Sep 13 2019, 7:59 PM
This revision was automatically updated to reflect the committed changes.
cem marked an inline comment as done.