From nobody Sun Oct 10 03:15:36 2021 X-Original-To: freebsd-fs@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 BDC2317EEC56; Sun, 10 Oct 2021 03:16:04 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vtr.rulingia.com (vtr.rulingia.com [IPv6:2001:19f0:5801:ebe:5400:1ff:fe53:30fd]) (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 (4096 bits) client-digest SHA256) (Client CN "vtr.rulingia.com", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HRnBV4V9rz3rf9; Sun, 10 Oct 2021 03:16:02 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from server.rulingia.com (2001-44b8-31fc-0d00-3593-b682-b9db-8db5.static.ipv6.internode.on.net [IPv6:2001:44b8:31fc:d00:3593:b682:b9db:8db5]) by vtr.rulingia.com (8.16.1/8.16.1) with ESMTPS id 19A3FjKL025770 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=OK); Sun, 10 Oct 2021 14:15:51 +1100 (AEDT) (envelope-from peter@rulingia.com) DKIM-Filter: OpenDKIM Filter v2.10.3 vtr.rulingia.com 19A3FjKL025770 X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.16.1/8.16.1) with ESMTPS id 19A3FbuR001793 (version=TLSv1.3 cipher=AEAD-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 10 Oct 2021 14:15:37 +1100 (AEDT) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.16.1/8.16.1/Submit) id 19A3FaPM001792; Sun, 10 Oct 2021 14:15:36 +1100 (AEDT) (envelope-from peter) Date: Sun, 10 Oct 2021 14:15:36 +1100 From: Peter Jeremy To: freebsd-stable@freebsd.org, freebsd-fs@freebsd.org Subject: Consistent panic with "zfs send --raw" Message-ID: List-Id: Filesystems List-Archive: https://lists.freebsd.org/archives/freebsd-fs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-fs@freebsd.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="akpPAPSmLbAxOzGE" Content-Disposition: inline X-PGP-Key: http://www.rulingia.com/keys/peter.pgp X-Rspamd-Queue-Id: 4HRnBV4V9rz3rf9 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=pass (policy=quarantine) header.from=rulingia.com; spf=pass (mx1.freebsd.org: domain of peter@rulingia.com designates 2001:19f0:5801:ebe:5400:1ff:fe53:30fd as permitted sender) smtp.mailfrom=peter@rulingia.com X-Spamd-Result: default: False [-5.90 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FREEFALL_USER(0.00)[peter]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; TO_DN_NONE(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; MID_RHS_MATCH_FROMTLD(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[rulingia.com,quarantine]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:20473, ipnet:2001:19f0:5800::/38, country:US]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N --akpPAPSmLbAxOzGE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I'm trying to replicate a filesystem with native encrytion enabled and am getting a consistent NULL pointer dereference panic. I'm running 13-stable fdbbd118faab but the code is identical in HEAD. Looking at the backtrace: #16 #17 dmu_dump_write (dscp=3Ddscp@entry=3D0xfffffe02501abc30, type=3D,=20 object=3D, offset=3D, offset@entry=3D0,= =20 lsize=3D, lsize@entry=3D131072, psize=3Dpsize@entry=3D13= 1072,=20 bp=3D0x0, data=3D0xfffffe02d94a6000) at /usr/src/sys/contrib/openzfs/module/zfs/dmu_send.c:493 #18 0xffffffff80410a3c in do_dump (dscp=3Ddscp@entry=3D0xfffffe02501abc30,= =20 range=3Drange@entry=3D0xfffff805fd82d900) at /usr/src/sys/contrib/openzfs/module/zfs/dmu_send.c:1016 #19 0xffffffff8040ead3 in dmu_send_impl (dspp=3D,=20 dspp@entry=3D0xfffffe02501abdf0) at /usr/src/sys/contrib/openzfs/module/zfs/dmu_send.c:2537 #20 0xffffffff8040d8fd in dmu_send_obj (pool=3D,=20 pool@entry=3D0xfffffe02d3b61000 "tank/compat@20210604bu", tosnap=3D1069= 0,=20 fromsnap=3D11065, embedok=3D, embedok@entry=3D1,=20 large_block_ok=3D, large_block_ok@entry=3D2,=20 compressok=3D, compressok@entry=3D4, rawok=3D8, savedok= =3D0,=20 outfd=3D1, off=3D0xfffffe02501ac070, dsop=3D0xfffffe02501ac058) at /usr/src/sys/contrib/openzfs/module/zfs/dmu_send.c:2695 dmu_send.c:493 is "ASSERT(!BP_IS_EMBEDDED(bp));" which dereferences bp with no checks for NULL, whereas dmu_send.c:1016 explicitly passes NULL to dmu_dump_write() as bp. This is obviously a bug somewhere. Looking at the comment at lines 1006-1008, it seems the code expects that raw sends will always have large block sends enabled, avoiding the problematic code block. And zfs-send(8) says that --raw implies --large-block if the source is not encrypted. But even if I explicitly specify --large-block then the code panics in the same way. (And --large-block as on option doesn't actually make sense with --raw because the send stream must match what's on local disk by definition). At this point, I'm not sure what the correct fix is. --=20 Peter Jeremy --akpPAPSmLbAxOzGE Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEE7rKYbDBnHnTmXCJ+FqWXoOSiCzQFAmFiWtBfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEVF QjI5ODZDMzA2NzFFNzRFNjVDMjI3RTE2QTU5N0EwRTRBMjBCMzQACgkQFqWXoOSi CzSQ0A/9FKtlwkAV1Icyobzwqs6t85aL+2zkoaOxHtCVhxIPrdDjc2T6h735C8Ur Q/KSNrGEfLoeaGwsY6oSg/PKERxcagMVX/x+xg/jeprVz7ty+8eeFwCnOekmA+GM 8W6zlotdpkV8DhQxnoFJny0+D1wCsceU5e3WjOPPkeI54LWBTawm9CGYD2gH+ON7 LqHuhOUM89LDXNnv/DvpSPP4CAfkRzkjMmjtlp5Qsw4ry8Lxv/K9n4b2leiFJkML acQwbM2bUEEdcTILKhJJrSGcBror1S21g1F58ediKboyWs2WdJkUJFbbH1H1cinj x1hmNOFW6fO4b0YqNGEaUs88p/T4llm/iG78Uh2xuBzsHcqS+jPsORjaIMxqR+TC D8QRvjWEoHnj1dPPqDZiv1y4hoE3LjxDlgg0S2HwKHstYtf2T7DttJdd1W1z0XvD xswCLDt0J4eduOKzSfNgs9U6hF+GB1OqYCOxlTsZgieL8b1XSG8oawtoV5z3VujU 2yKVHmwfdzfhHI5WEjiJO8fMWy3PshuVVoiTE9tS61aa+BJQrRafrAJQfa0tMGIr E+wB5qyg2pGgpSi+T+ZVcxQr6B55cCFdVanJZkiVmgXck5m3+MmjX5c5ehyUPCH8 Ono2bj0Ry8W7N95d39DCxzWLU2pvVjwLI8xfc291EIYkby0Wk9w= =eIVH -----END PGP SIGNATURE----- --akpPAPSmLbAxOzGE--