This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2183446 - [RHEL8] ndctl keys not removed after ndctl sanitize-dimm operation
Summary: [RHEL8] ndctl keys not removed after ndctl sanitize-dimm operation
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: ndctl
Version: 8.8
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Jeff Moyer
QA Contact: Storage QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-03-31 07:30 UTC by Zhang Yi
Modified: 2023-09-23 13:02 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-09-23 13:02:27 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker   RHEL-8060 0 None Migrated None 2023-09-23 13:02:25 UTC
Red Hat Issue Tracker RHELPLAN-153710 0 None None None 2023-03-31 07:32:40 UTC

Description Zhang Yi 2023-03-31 07:30:32 UTC
Description of problem:


Version-Release number of selected component (if applicable):
4.18.0-482.el8.x86_64
ndctl-71.1-4.el8.x86_64

How reproducible:


Steps to Reproduce:
1. Pls check additional info for detailed steps
2.
3.

Actual results:
After sanitize-dimm operation finished, the security state changed to "disabled", and the key still exists under /etc/ndctl/kerys.
After system reboot, seems the key setup again and the security state changed to "unlocked", I have to manually remove-passphrase to disable the security state.

Here is part of the manual from ndctl sanitize-dimm
"
Additionally, after completion of this command, the security and passphrase for the given NVDIMM will be disabled, and the passphrase and any key material will also be removed from the keyring and the ndctl keys directory at /etc/ndctl/keys
"

Expected results:


Additional info:

[root@intel-purley-04 ~]# keypath=/etc/ndctl/keys
[root@intel-purley-04 ~]# masterkey=nvdimm-master
[root@intel-purley-04 ~]# masterpath="$keypath/$masterkey.blob"
[root@intel-purley-04 ~]# dev=nmem0
[root@intel-purley-04 ~]# dd if=/dev/urandom bs=1 count=32 2>/dev/null | keyctl padd user "$masterkey" @u
891331308
[root@intel-purley-04 ~]# keyctl pipe "$(keyctl search @u user $masterkey)" > "$masterpath"

[root@intel-purley-04 ~]# ndctl setup-passphrase "$dev" -k user:"$masterkey"
passphrase enabled for 1 nmem.

[root@intel-purley-04 ~]# ndctl list -Di
[
  {
    "dev":"nmem1",
    "id":"8089-a2-1833-00000510",
    "handle":257,
    "phys_id":32,
    "flag_failed_map":true,
    "security":"disabled"
  },
  {
    "dev":"nmem3",
    "id":"8089-a2-1833-00000497",
    "handle":4353,
    "phys_id":44,
    "security":"disabled"
  },
  {
    "dev":"nmem0",
    "id":"8089-a2-1833-000004a3",
    "handle":1,
    "phys_id":26,
    "security":"unlocked"
  },
  {
    "dev":"nmem2",
    "id":"8089-a2-1833-000004a9",
    "handle":4097,
    "phys_id":38,
    "security":"disabled"
  }
]
[root@intel-purley-04 ~]# ls /etc/ndctl/keys/
keys.readme  nvdimm_8089-a2-1833-000004a3_intel-purley-04.khw1.lab.eng.bos.redhat.com.blob  nvdimm-master.blob

[root@intel-purley-04 ~]# ndctl sanitize-dimm nmem0 --overwrite
overwrite issued for 1 nmem.

[root@intel-purley-04 ~]# ls /etc/ndctl/keys/
keys.readme  nvdimm_8089-a2-1833-000004a3_intel-purley-04.khw1.lab.eng.bos.redhat.com.blob  nvdimm-master.blob

[root@intel-purley-04 ~]# ndctl list -D
[
  {
    "dev":"nmem1",
    "id":"8089-a2-1833-00000510",
    "handle":257,
    "phys_id":32,
    "flag_failed_map":true,
    "security":"disabled"
  },
  {
    "dev":"nmem3",
    "id":"8089-a2-1833-00000497",
    "handle":4353,
    "phys_id":44,
    "security":"disabled"
  },
  {
    "dev":"nmem0",
    "id":"8089-a2-1833-000004a3",
    "handle":1,
    "phys_id":26,
    "security":"disabled"
  },
  {
    "dev":"nmem2",
    "id":"8089-a2-1833-000004a9",
    "handle":4097,
    "phys_id":38,
    "security":"disabled"
  }
]



[ 1982.925177] acpi_nfit_ctl:527: nfit ACPI0012:00: nmem0 cmd: 10: func: 26 input length: 0
[ 1982.926183] acpi_nfit_ctl:571: nfit ACPI0012:00: nmem0 cmd: cmd_call output length: 4
[ 1982.926186] cmd_call00000000: 00010007                             ....
[ 2134.471707] acpi_nfit_ctl:527: nfit ACPI0012:00: nmem0 cmd: 10: func: 26 input length: 0
[ 2134.472774] acpi_nfit_ctl:571: nfit ACPI0012:00: nmem0 cmd: cmd_call output length: 4
[ 2134.472777] cmd_call00000000: 00000000                             ....
[ 2134.483220] __nvdimm_security_overwrite_query:442: nvdimm nmem0: overwrite completed
[ 2134.483232] acpi_nfit_ctl:527: nfit ACPI0012:00: nmem0 cmd: 10: func: 19 input length: 0
[ 2134.483895] acpi_nfit_ctl:571: nfit ACPI0012:00: nmem0 cmd: cmd_call output length: 9
[ 2134.483898] cmd_call00000000: 00 00 00 00 00 00 00 00 42                       ........B
[ 2134.483900] acpi_nfit_ctl:527: nfit ACPI0012:00: nmem0 cmd: 10: func: 19 input length: 0
[ 2134.485195] acpi_nfit_ctl:571: nfit ACPI0012:00: nmem0 cmd: cmd_call output length: 9
[ 2134.485196] cmd_call00000000: 00 00 00 00 00 00 00 00 42  



Reboot operation

[root@intel-purley-04 ~]# ndctl list -Di
[
  {
    "dev":"nmem1",
    "id":"8089-a2-1833-00000510",
    "handle":257,
    "phys_id":32,
    "flag_failed_map":true,
    "security":"disabled"
  },
  {
    "dev":"nmem3",
    "id":"8089-a2-1833-00000497",
    "handle":4353,
    "phys_id":44,
    "security":"disabled"
  },
  {
    "dev":"nmem0",
    "id":"8089-a2-1833-000004a3",
    "handle":1,
    "phys_id":26,
    "security":"unlocked"
  },
  {
    "dev":"nmem2",
    "id":"8089-a2-1833-000004a9",
    "handle":4097,
    "phys_id":38,
    "security":"disabled"
  }
]

Comment 1 Jeff Moyer 2023-05-16 18:28:38 UTC
Upstream issue, reported by Zhang Yi: https://github.com/pmem/ndctl/issues/239

Comment 2 RHEL Program Management 2023-09-23 13:01:26 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 3 RHEL Program Management 2023-09-23 13:02:27 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.


Note You need to log in before you can comment on or make changes to this bug.