From nobody Tue Aug 02 19:41:27 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ly52y0crdz4Y4PX; Tue, 2 Aug 2022 19:41:30 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta001.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ly52x1FhQz4FrL; Tue, 2 Aug 2022 19:41:29 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from shw-obgw-4002a.ext.cloudfilter.net ([10.228.9.250]) by cmsmtp with ESMTP id Is8Jo3ebzS8WrIxlgo9F8i; Tue, 02 Aug 2022 19:41:28 +0000 Received: from spqr.komquats.com ([70.66.148.124]) by cmsmtp with ESMTPA id IxlfoRb4IC3uhIxlgo8VCB; Tue, 02 Aug 2022 19:41:28 +0000 X-Authority-Analysis: v=2.4 cv=a6MjSGeF c=1 sm=1 tr=0 ts=62e97de8 a=Cwc3rblV8FOMdVN/wOAqyQ==:117 a=Cwc3rblV8FOMdVN/wOAqyQ==:17 a=kj9zAlcOel0A:10 a=biHskzXt2R4A:10 a=6I5d2MoRAAAA:8 a=pGLkceISAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=TJm90aPjNwFuEfPhVL0A:9 a=uq9pco6RwR2WAPVo:21 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 72A81A9; Tue, 2 Aug 2022 12:41:27 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 3D45EC4; Tue, 2 Aug 2022 12:41:27 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: "Alexander V. Chernikov" cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 29029b06a6f7 - main - routing: remove info argument from add/change_route_nhop(). In-reply-to: <202208010853.2718rMqh090712@gitrepo.freebsd.org> References: <202208010853.2718rMqh090712@gitrepo.freebsd.org> Comments: In-reply-to "Alexander V. Chernikov" message dated "Mon, 01 Aug 2022 08:53:22 +0000." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 02 Aug 2022 12:41:27 -0700 Message-Id: <20220802194127.3D45EC4@slippy.cwsent.com> X-CMAE-Envelope: MS4xfG4r6cXU52FdkRtqTGFT6ECZX4L70rl4OQ00j9t+E2Eex4gGJoiDCu5JVQNBTU8P2uGEzTbm7ACewyHg0hs0icYpCQX84+hHHcGMI5/aHYlc47Y9sgZ4 g6GpHp8kqWdVRJpfCZPHphkaVjF9/lIsHU5AO2pfNHIbKikqWDIBcwdsgrCDKwp01UCfwnEmLjV95YtqOavn7MaC/US/6CrOWkef02ozDGpQGhh2r3MBo21m MQUfsxdjKUGHLYk6cxIaqrR6LpmZ9VYm5PfJYhmRnVY2t9CBNba9fK+uwcJHpkhy8w9sM595F8IBO9qEgbzoeVIfhX6xLSSDzJcYkmlekEc= X-Rspamd-Queue-Id: 4Ly52x1FhQz4FrL X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 3.97.99.32) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [-1.80 / 15.00]; AUTH_NA(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; NEURAL_HAM_MEDIUM(-1.00)[-0.998]; MV_CASE(0.50)[]; RCVD_IN_DNSWL_MED(-0.20)[3.97.99.32:from]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; R_SPF_NA(0.00)[no SPF record]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org,dev-commits-src-all@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; RCVD_VIA_SMTP_AUTH(0.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; DMARC_NA(0.00)[cschubert.com: no valid DMARC record]; RCVD_TLS_LAST(0.00)[] X-ThisMailContainsUnwantedMimeParts: N In message <202208010853.2718rMqh090712@gitrepo.freebsd.org>, "Alexander V. Che rnikov" writes: > The branch main has been updated by melifaro: > > URL: https://cgit.FreeBSD.org/src/commit/?id=29029b06a6f7fd51c34c9db88cc98a66 > 53ee5046 > > commit 29029b06a6f7fd51c34c9db88cc98a6653ee5046 > Author: Alexander V. Chernikov > AuthorDate: 2022-07-28 13:41:11 +0000 > Commit: Alexander V. Chernikov > CommitDate: 2022-08-01 07:41:07 +0000 > > routing: remove info argument from add/change_route_nhop(). > > Currently, rt_addrinfo(info) serves as a main "transport" moving > state between various functions inside the routing subsystem. > As all of the fields are filled in directly by the customers, it > is problematic to maintain consistency, resulting in repeated checks > inside many functions. Additionally, there are multiple ways of > specifying the same value (RTAX_IFP vs rti_ifp / rti_ifa) and so on. > With the upcoming nhop(9) kpi it is possible to store all of the > required state in the nexthops in the consistent fashion, reducing the > need to use "info" in the KPI calls. > Finally, rt_addrinfo structure format was derived from the rtsock wire > format, which is different from other kernel routing users or netlink. > > This cleanup simplifies upcoming nhop(9) kpi and netlink introduction. > > Reviewed by: zlei.huang@gmail.com > Differential Revision: https://reviews.freebsd.org/D35972 > MFC after: 2 weeks Hi, Just picking this commit: One of these routing commits has caused a panic during setup of gif(4) to Tunnelbroker. <118>Created clone interfaces: gif0 bridge0. <6>lo0: link state changed to UP <6>sk0: link state changed to DOWN <6>xl0: link state changed to DOWN <6>fxp0: link state changed to DOWN <6>nfe0: link state changed to DOWN <6>nfe1: link state changed to DOWN Fatal trap 12: page fault while in kernel mode cpuid = 1; apic id = 01 fault virtual address = 0x70 fault code = supervisor read data, page not present instruction pointer = 0x20:0xffffffff80806c66 stack pointer = 0x28:0xfffffe00c43387b0 frame pointer = 0x28:0xfffffe00c4338810 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 513 (ifconfig) trap number = 12 panic: page fault cpuid = 1 time = 1659466745 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00c4338570 vpanic() at vpanic+0x151/frame 0xfffffe00c43385c0 panic() at panic+0x43/frame 0xfffffe00c4338620 trap_fatal() at trap_fatal+0x387/frame 0xfffffe00c4338680 trap_pfault() at trap_pfault+0x4f/frame 0xfffffe00c43386e0 calltrap() at calltrap+0x8/frame 0xfffffe00c43386e0 --- trap 0xc, rip = 0xffffffff80806c66, rsp = 0xfffffe00c43387b0, rbp = 0xfffffe 00c4338810 --- nhop_get_nhop() at nhop_get_nhop+0x26/frame 0xfffffe00c4338810 nhop_create_from_info() at nhop_create_from_info+0x20c/frame 0xfffffe00c4338860 rib_add_route() at rib_add_route+0x1e9/frame 0xfffffe00c43388e0 rib_handle_ifaddr_info() at rib_handle_ifaddr_info+0xd7/frame 0xfffffe00c4338950 in6_update_ifa() at in6_update_ifa+0xb6d/frame 0xfffffe00c4338ad0 in6_control() at in6_control+0x83c/frame 0xfffffe00c4338bc0 ifioctl() at ifioctl+0x7bc/frame 0xfffffe00c4338cc0 kern_ioctl() at kern_ioctl+0x26d/frame 0xfffffe00c4338d30 sys_ioctl() at sys_ioctl+0x100/frame 0xfffffe00c4338e00 amd64_syscall() at amd64_syscall+0x10c/frame 0xfffffe00c4338f30 fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe00c4338f30 --- syscall (54, FreeBSD ELF64, sys_ioctl), rip = 0x640bee2d97a, rsp = 0x640bb37 3718, rbp = 0x640bb373760 --- Uptime: 22s Dumping 370 out of 5089 MB:..5%..13%..22%..31%..44%..52%..61%..74%..83%..91% __curthread () at /opt/src/git-src/sys/amd64/include/pcpu_aux.h:59 59 __asm("movq %%gs:%P1,%0" : "=r" (td) : "n" (offsetof(struct pcpu , (kgdb) #0 __curthread () at /opt/src/git-src/sys/amd64/include/pcpu_aux.h:5 9 #1 dump_savectx () at /opt/src/git-src/sys/kern/kern_shutdown.c:405 #2 0xffffffff806be738 in dumpsys (di=0x0) at /opt/src/git-src/sys/x86/include/dump.h:87 #3 doadump (textdump=1) at /opt/src/git-src/sys/kern/kern_shutdown.c:434 #4 kern_reboot (howto=260) at /opt/src/git-src/sys/kern/kern_shutdown.c:541 #5 0xffffffff806bec1e in vpanic (fmt=, ap=ap@entry=0xfffffe00c4338600) at /opt/src/git-src/sys/kern/kern_shutdown.c:979 #6 0xffffffff806bea53 in panic (fmt=) at /opt/src/git-src/sys/kern/kern_shutdown.c:903 #7 0xffffffff80a34bb7 in trap_fatal (frame=0xfffffe00c43386f0, eva=112) at /opt/src/git-src/sys/amd64/amd64/trap.c:942 #8 0xffffffff80a34c0f in trap_pfault (frame=0xfffffe00c43386f0, usermode=false, signo=, ucode=) at /opt/src/git-src/sys/amd64/amd64/trap.c:761 #9 #10 0xffffffff80806c66 in get_aifp (nh=0xfffff8002291a200) at /opt/src/git-src/sys/net/route/nhop_ctl.c:138 #11 nhop_get_nhop (nh=nh@entry=0xfffff8002291a200, perror=perror@entry=0xfffffe00c4338834) at /opt/src/git-src/sys/net/route/nhop_ctl.c:319 #12 0xffffffff8080680c in nhop_create_from_info ( rnh=rnh@entry=0xfffff80004924400, info=info@entry=0xfffffe00c4338a20, nh_ret=nh_ret@entry=0xfffffe00c4338890) at /opt/src/git-src/sys/net/route/nhop_ctl.c:299 #13 0xffffffff8080c6a9 in create_rtentry (rnh=0xfffff80004924400, info=0xfffffe00c4338a20, prt=) at /opt/src/git-src/sys/net/route/route_ctl.c:661 #14 add_route (rnh=0xfffff80004924400, info=0xfffffe00c4338a20, rc=0xfffffe00c43388f8) at /opt/src/git-src/sys/net/route/route_ctl.c:713 #15 rib_add_route (fibnum=, info=0xfffffe00c4338a20, rc=0xfffffe00c43388f8) at /opt/src/git-src/sys/net/route/route_ctl.c:586 #16 0xffffffff8080d4bf in rib_action (fibnum=579969536, action=action@entry=1, info=0xfffffe00c4338834, rc=0xfffff8002291a280, rc@entry=0xfffffe00c43388f8) at /opt/src/git-src/sys/net/route/route_ctl.c:1257 #17 0xffffffff8080f3d7 in rib_handle_ifaddr_one (fibnum=0, cmd=1, info=0xfffffe00c4338a20) at /opt/src/git-src/sys/net/route/route_ifaddrs.c:81 #18 rib_handle_ifaddr_info (fibnum=579969536, cmd=cmd@entry=1, info=0x100004, info@entry=0xfffffe00c4338a20) at /opt/src/git-src/sys/net/route/route_ifaddrs.c:107 #19 0xffffffff8087001d in in6_handle_dstaddr_rtrequest (cmd=1, ia=0xfffff80022887480) at /opt/src/git-src/sys/netinet6/in6.c:1307 #20 in6_notify_ifa (ifp=, ia=, ifra=, hostIsNew=) at /opt/src/git-src/sys/netinet6/in6.c:1518 #21 in6_update_ifa_internal (ifp=0xfffff80022721800, ifra=0xfffff8000799e400, ia=0xfffff80022887480, hostIsNew=, flags=) at /opt/src/git-src/sys/netinet6/in6.c:1196 #22 in6_update_ifa (ifp=0xfffff80022721800, ifra=0xfffff8000799e400, ia=0xfffff80022887480, flags=flags@entry=0) at /opt/src/git-src/sys/netinet6/in6.c:899 #23 0xffffffff8086effc in in6_control (so=, cmd=, data=, ifp=, td=) at /opt/src/git-src/sys/netinet6/in6.c:572 #24 0xffffffff807e465c in ifioctl (so=0xfffff80016ffa000, cmd=2156423451, data=, td=0x0) at /opt/src/git-src/sys/net/if.c:3189 #25 0xffffffff807310ad in fo_ioctl (fp=0xfffff8000775cc80, com=18446741877978007604, data=0x100004, active_cred=0xfffff8002291a280, td=0xfffffe00c44acac0) at /opt/src/git-src/sys/sys/file.h:365 #26 kern_ioctl (td=0x0, td@entry=0xfffffe00c44acac0, fd=, com=18446741877978007604, com@entry=2156423451, data=0x100004 , data@entry=0xfffff8000799e400 "gif0") at /opt/src/git-src/sys/kern/sys_generic.c:803 #27 0xffffffff80730d90 in sys_ioctl (td=0xfffffe00c44acac0, uap=0xfffffe00c44aceb0) at /opt/src/git-src/sys/kern/sys_generic.c:711 #28 0xffffffff80a354ac in syscallenter (td=0xfffffe00c44acac0) at /opt/src/git-src/sys/amd64/amd64/../../kern/subr_syscall.c:189 #29 amd64_syscall (td=0xfffffe00c44acac0, traced=0) at /opt/src/git-src/sys/amd64/amd64/trap.c:1187 #30 #31 0x00000640bee2d97a in ?? () Backtrace stopped: Cannot access memory at address 0x640bb373718 (kgdb) At the point of panic we see: (kgdb) l 133 * the packet back to ourselves, the ifp would be the loopback 134 * interface. However, we'd rather know the interface associated 135 * to the destination address (which should probably be one of 136 * our own addresses). 137 */ 138 if ((nh->nh_ifp->if_flags & IFF_LOOPBACK) && 139 nh->gw_sa.sa_family == AF_LINK) { 140 aifp = ifnet_byindex(nh->gwl_sa.sdl_index); 141 if (aifp == NULL) { 142 FIB_NH_LOG(LOG_WARNING, nh, "unable to get aifp for %s index %d", (kgdb) p nh $1 = (const struct nhop_object *) 0xfffff8002291a200 (kgdb) p nh->nh_ifp $2 = (struct ifnet *) 0x0 My relevant rc.conf lines are: if kqcheckyesno use_tunnelbroker; then # tunnelbroker tunnel_broker="gif0" create_args_gif0="tunnel MY_IPv4_ADDR REMOTE_IPv4_ADDR" ifconfig_gif0_ipv6="inet6 MY_ASSIGNED_IPv6_TUNNEL_ENDPOINT_ADDR prefixlen 128 mtu 1480" ipv6_defaultrouter="MY_IPv6_REMOTE_TUNNEL_ENDPOINT_ADDR" ipv6_gateway_enable="YES" rtsold_enable="YES" # Set to YES to enable an IPv6 router rtsold_flags="-F -m gif0" # Flags to an IPv6 router solicitation else rtsold_enable="NO" # Set to YES to enable an IPv6 router tunnel_broker='' fi -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org NTP: Web: https://nwtime.org e**(i*pi)+1=0