Sean Christopherson d5760dee12 crypto: ccp: Reject SEV commands with mismatching command buffer
WARN on and reject SEV commands that provide a valid data pointer, but do
not have a known, non-zero length.  And conversely, reject commands that
take a command buffer but none is provided (data is null).

Aside from sanity checking input, disallowing a non-null pointer without
a non-zero size will allow a future patch to cleanly handle vmalloc'd
data by copying the data to an internal __pa() friendly buffer.

Note, this also effectively prevents callers from using commands that
have a non-zero length and are not known to the kernel.  This is not an
explicit goal, but arguably the side effect is a good thing from the
kernel's perspective.

Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210406224952.4177376-4-seanjc@google.com>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-04-21 12:20:06 -04:00
..
2021-02-26 09:41:03 -08:00
2021-02-24 10:25:37 -08:00
2021-03-07 13:24:44 -08:00
2021-02-22 14:44:39 -08:00
2021-02-23 15:05:10 -08:00
2021-03-14 12:54:56 -07:00
2021-02-22 10:05:12 -08:00
2021-02-22 14:27:07 -08:00
2021-02-22 09:52:55 -08:00
2021-02-28 15:48:25 -08:00
2021-03-05 12:26:24 -08:00
2021-03-12 13:25:49 -08:00
2021-03-13 12:38:44 -08:00
2021-02-24 10:25:37 -08:00
2021-02-24 09:35:54 -08:00
2021-02-24 10:25:37 -08:00
2021-03-12 11:34:36 -08:00
2021-02-25 12:23:49 -08:00
2021-03-12 13:25:49 -08:00
2021-03-12 13:37:18 -08:00
2021-02-26 14:16:06 -08:00
2021-02-22 14:34:00 -08:00
2021-02-28 11:51:20 -08:00
2021-02-09 16:10:49 +01:00
2021-03-13 12:34:29 -08:00
2021-03-13 12:32:57 -08:00
2021-02-24 10:43:40 -08:00
2021-02-25 12:21:08 -08:00
2021-02-09 12:15:07 +01:00
2021-03-12 11:34:36 -08:00