Messages in this thread | | | Date | Fri, 13 May 2022 00:02:21 +0200 | From | Borislav Petkov <> | Subject | Re: [PATCH] KVM: SVM: Use kzalloc for sev ioctl interfaces to prevent kernel memory leak. |
| |
On Thu, May 12, 2022 at 08:23:28PM +0000, Ashish Kalra wrote: > From: Ashish Kalra <ashish.kalra@amd.com> > > For some sev ioctl interfaces, the length parameter that is passed maybe > less than or equal to SEV_FW_BLOB_MAX_SIZE, but larger than the data > that PSP firmware returns. In this case, kmalloc will allocate memory > that is the size of the input rather than the size of the data. > Since PSP firmware doesn't fully overwrite the allocated buffer, these > sev ioctl interface may return uninitialized kernel slab memory. > > Reported-by: Andy Nguyen <theflow@google.com> > Suggested-by: David Rientjes <rientjes@google.com> > Suggested-by: Peter Gonda <pgonda@google.com> > Cc: kvm@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Signed-off-by: Ashish Kalra <ashish.kalra@amd.com>
This looks like it needs one (or more) Fixes: tags pointing to the patch(es) adding those kmalloc calls...
And then Cc: <stable@vger.kernel.org> too.
-- Regards/Gruss, Boris.
https://people.kernel.org/tglx/notes-about-netiquette
| |