]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
libnvdimm/security: ensure sysfs poll thread woke up and fetch updated attr
authorJane Chu <jane.chu@oracle.com>
Mon, 3 Aug 2020 22:41:39 +0000 (16:41 -0600)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Fri, 4 Sep 2020 19:30:08 +0000 (16:30 -0300)
commit55b5a46072248f8998a04358de72d980002808ab
treeda88bc309331d0a2b3ca8095fe04d45e2b9b9b53
parentd432dc97e08cd762beb273812e549021d7b353bc
libnvdimm/security: ensure sysfs poll thread woke up and fetch updated attr

BugLink: https://bugs.launchpad.net/bugs/1892899
[ Upstream commit 7f674025d9f7321dea11b802cc0ab3f09cbe51c5 ]

commit 7d988097c546 ("acpi/nfit, libnvdimm/security: Add security DSM overwrite support")
adds a sysfs_notify_dirent() to wake up userspace poll thread when the "overwrite"
operation has completed. But the notification is issued before the internal
dimm security state and flags have been updated, so the userspace poll thread
wakes up and fetches the not-yet-updated attr and falls back to sleep, forever.
But if user from another terminal issue "ndctl wait-overwrite nmemX" again,
the command returns instantly.

Link: https://lore.kernel.org/r/1596494499-9852-3-git-send-email-jane.chu@oracle.com
Fixes: 7d988097c546 ("acpi/nfit, libnvdimm/security: Add security DSM overwrite support")
Cc: Dave Jiang <dave.jiang@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Jane Chu <jane.chu@oracle.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/nvdimm/security.c