From nobody Thu Jan 27 17:11:01 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 87BE9199490A; Thu, 27 Jan 2022 17:11:03 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Jl6Yg13vrz4bgc; Thu, 27 Jan 2022 17:11:02 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.16.1/8.16.1) with ESMTPS id 20RHB1E0049186 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 27 Jan 2022 09:11:01 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.16.1/8.16.1/Submit) id 20RHB1x1049185; Thu, 27 Jan 2022 09:11:01 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Thu, 27 Jan 2022 09:11:01 -0800 From: Gleb Smirnoff To: Mateusz Guzik Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: e1882428dcbb - main - ifnet/mbuf: provide KPI to serialize/restore m->m_pkthdr.rcvif Message-ID: References: <202201270600.20R602KH059925@gitrepo.freebsd.org> 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 Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4Jl6Yg13vrz4bgc X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N Mateusz, On Thu, Jan 27, 2022 at 05:59:03PM +0100, Mateusz Guzik wrote: M> --- trap 0xc, rip = 0xffffffff80616d98, rsp = 0xfffffe06462889e0, rbp M> = 0xfffffe06462889e0 --- M> m_rcvif_serialize() at m_rcvif_serialize+0x8/frame 0xfffffe06462889e0 M> netisr_queue_src() at netisr_queue_src+0x15c/frame 0xfffffe0646288a30 M> route_output() at route_output+0x890/frame 0xfffffe0646288c70 M> sosend_generic() at sosend_generic+0x456/frame 0xfffffe0646288d10 M> soo_write() at soo_write+0x43/frame 0xfffffe0646288d40 M> dofilewrite() at dofilewrite+0x81/frame 0xfffffe0646288d90 M> sys_write() at sys_write+0xbc/frame 0xfffffe0646288e00 M> amd64_syscall() at amd64_syscall+0x107/frame 0xfffffe0646288f30 M> fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe0646288f30 M> --- syscall (4, FreeBSD ELF64, sys_write), rip = 0x3b000ba6703a, rsp = The breaking commit is 6871de9363e559fef6765f0e49acc47f77544999, not exactly this one. This means route_output() tries to queue on netisr an mbuf without rcvif set. And by means of route protocol it is legitimate. The question is how did that work before? If we look at netisr.c before my change, we see that on dequeuing we would require the rcvif for VIMAGE case: netisr_process_workstream_proto(): VNET_ASSERT(m->m_pkthdr.rcvif != NULL, ("%s:%d rcvif == NULL: m=%p", __func__, __LINE__, m)); CURVNET_SET(m->m_pkthdr.rcvif->if_vnet); netisr_proto[proto].np_handler(m); This won't panic without VIMAGE however. It also is dereferenced in netisr_drain_proto_vnet(), but apparently this function is also disabled without VIMAGE. -- Gleb Smirnoff