Linux CXL
 help / color / mirror / Atom feed
* CXL device sanitation and pmem security questions
@ 2022-07-07 19:05 Davidlohr Bueso
  2022-07-07 19:30 ` Davidlohr Bueso
  2022-07-07 21:06 ` Dave Jiang
  0 siblings, 2 replies; 5+ messages in thread
From: Davidlohr Bueso @ 2022-07-07 19:05 UTC (permalink / raw)
  To: linux-cxl
  Cc: dan.j.williams, Jonathan.Cameron, vishal.l.verma,
	alison.schofield, a.manzanares, dave

Hello,

While going through the Sanitize and Pmem Data-at-rest security parts
of the 2.0 spec, I was wondering if the community had any ideas about
how this would look when implemented. I am not a security person, but
this is how I'm interpreting this stuff.

1. Sanitize (8.2.9.5.5) which includes volatile and persistent regions.

Have a /sys/bus/cxl/devices/memX/erase write-only file which upon 0 or 1
values will do sanitize or secure erase, respectively. In case of the
sanitize command, if this is a background operation, the echo/write will
wait until complete. Alternatively we could just rely on the next sanitize
command to just return media disabled error if the previous one is still
running and not worry.

While this command is running with media disabled state, what happens
when successfully complete? Does the state change and loads/stores have
effect again? Does the driver need to do anything here? There is little
info about this. Similarly, the secure erase is done entirely by hw (both
having no in/out payloads).

Both commands note that prior to using them, "any security applied to
the user data areas of the device shall be disabled" (or unlocked for
secure erase). Is this referring only to the PMEM part (below)? Iow,
get security capabilities would need to be consulted (for the
CONFIG_CXL_PMEM cases)? Or would this check be done by hardware instead
and return error if the security requirements are not met?

The cxl cmd would look like:

#> cxl sanitize mem0 (alternatively pass -E for secure erase).

2. Pmem Security (8.2.9.5.6)

Will this be along the same lines as what nvdimm does[1]? and have a
/sys/bus/cxl/devices/memX/security file that multiplexes the
different security features. Alternatively I guess the above could
also be done within the same security file, instead of having two.

The cxl cmd would look like, based on what ndctl(1) does; as well
as the -m master option:

#> cxl load-keys <params>
#> cxl setup-passphrase mem0
#> cxl update-passphrase mem0
#> cxl remove-passphrase mem0
#> cxl unlock mem0
#> cxl sanitize -PE mem0 (passphrase secure erase)
#> cxl freeze-security mem0

[1] https://www.kernel.org/doc/html/latest/driver-api/nvdimm/security.html

Thanks,
Davidlohr

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-07-08 17:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-07 19:05 CXL device sanitation and pmem security questions Davidlohr Bueso
2022-07-07 19:30 ` Davidlohr Bueso
2022-07-07 21:06 ` Dave Jiang
2022-07-08 17:24   ` Davidlohr Bueso
2022-07-08 17:44     ` Dave Jiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox