From owner-freebsd-bugs@freebsd.org Wed Feb 17 19:57:23 2021 Return-Path: Delivered-To: freebsd-bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5821852F53F for ; Wed, 17 Feb 2021 19:57:23 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 4DgpXM1s3Nz3J37 for ; Wed, 17 Feb 2021 19:57:23 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 3F15952F7AF; Wed, 17 Feb 2021 19:57:23 +0000 (UTC) Delivered-To: bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3EDCD52F7AE for ; Wed, 17 Feb 2021 19:57:23 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DgpXM1Fg4z3J0v for ; Wed, 17 Feb 2021 19:57:23 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1DEEB2954 for ; Wed, 17 Feb 2021 19:57:23 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 11HJvNNO096004 for ; Wed, 17 Feb 2021 19:57:23 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 11HJvNQf096003 for bugs@FreeBSD.org; Wed, 17 Feb 2021 19:57:23 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 253595] ccp(4) breaks ZFS Date: Wed, 17 Feb 2021 19:57:23 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 13.0-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: jsorocil@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Feb 2021 19:57:23 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D253595 Bug ID: 253595 Summary: ccp(4) breaks ZFS Product: Base System Version: 13.0-STABLE Hardware: amd64 OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: jsorocil@gmail.com Created attachment 222535 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D222535&action= =3Dedit core.txt Loading ccp (either in rc.conf's kld_list or manually kldloading module aft= er boot) breaks ZFS encryption - I can't load keys for existing dataset and creating new one results in kernel panic. Try to load ZFS dataset key % kldload ccp % zfs load-key data Enter passphrase for 'data': Key load error: Incorrect key provided for 'data'. Enter passphrase for 'data': Key load error: Incorrect key provided for 'data'. Enter passphrase for 'data': Key load error: Incorrect key provided for 'data'. zsh: exit 255 zfs load-key data One way to reproduce kernel panic: truncate -s 10G pool mdconfig -at vnode -f pool zpool create -m /mnt/test -O compress=3Dlz4 -O atime=3Doff -O devices=3Doff= -O setuid=3Doff -O exec=3Doff -O encryption=3Don -O keyformat=3Dpassphrase tes= t /dev/md0 Other way to reproduce kernel panic: Try to create encrypted partition on existing pool (doesn't matter if root = of the pool is encrypted or not): zfs create -o encryption=3Don -o keyformat=3Dpassphrase zroot/encrypted % cat /var/crash/info.last Dump header from device: /dev/gpt/hdd-swap Architecture: amd64 Architecture Version: 2 Dump Length: 1346650112 Blocksize: 512 Compression: none Dumptime: 2021-02-17 20:47:17 +0100 Hostname: zen-pobro Magic: FreeBSD Kernel Dump Version String: FreeBSD 13.0-BETA2 #2 r13.0-n244512-726e20f45041: Wed Feb= 17 20:26:38 CET 2021 root@zen-pobro:/usr/obj/usr/src/amd64.amd64/sys/GENERIC Panic String: VERIFY3(0 =3D=3D zio_crypt_key_wrap(&dck->dck_wkey->wk_key,= key, iv, mac, keydata, hmac_keydata)) failed (0 =3D=3D 5) Dump Parity: 2673242901 Bounds: 4 Dump Status: good % dmesg ... CPU: AMD Ryzen 7 PRO 4750G with Radeon Graphics (3593.33-MHz K8-class CPU) Origin=3D"AuthenticAMD" Id=3D0x860f01 Family=3D0x17 Model=3D0x60 Step= ping=3D1 =20 Features=3D0x178bfbff =20 Features2=3D0x7ed8320b AMD Features=3D0x2e500800 AMD Features2=3D0x75c237ff Structured Extended Features=3D0x219c91a9 Structured Extended Features2=3D0x400004 XSAVE Features=3D0xf AMD Extended Feature Extensions ID EBX=3D0x90cf757 SVM: NP,NRIP,VClean,AFlush,DAssist,NAsids=3D32768 TSC: P-state invariant, performance statistics ... ccp0: mem 0xfcc00000-0xfccfffff,0xfcd8c000-0xfcd8dfff at device 0.2 on pci9 random: registering fast source AMD CCP TRNG % pciconf -lv none2@pci0:9:0:2: class=3D0x108000 rev=3D0x00 hdr=3D0x00 vendor=3D0x1= 022 device=3D0x15df subvendor=3D0x1022 subdevice=3D0x15df vendor =3D 'Advanced Micro Devices, Inc. [AMD]' device =3D 'Family 17h (Models 10h-1fh) Platform Security Processor' class =3D encrypt/decrypt Reproduced on FreeBSD 13.0-ALPHA3, 13.0-BETA2 and 14.0-CURRENT (commit 4a7d84058d Wed Feb 17 11:45:54 2021 +0100) If ccp module is not loaded: % zfs load-key data Enter passphrase for 'data': % zfs create -o encryption=3Don -o keyformat=3Dpassphrase zroot/encrypted --=20 You are receiving this mail because: You are the assignee for the bug.=