lkml.org 
[lkml]   [2017]   [Oct]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Part2 PATCH v6 32/38] KVM: SVM: Add support for SEV DEBUG_DECRYPT command
On Mon, Oct 30, 2017 at 08:56:13AM -0500, Brijesh Singh wrote:
> I am not able to reproduce the build warning in my setup, what config
> option or compiler you are using to  trigger this issue ?

gcc7 has gotten smarter.

> I am on Fedora with gcc 6.4.x. Logically, the code looks okay. I can
> try to rearrange code to fix the warning. I have not touched this
> function since couple of rev, have u seen similar warning in previous
> versions (v5, v4 etc). thanks

Lemme see:

sev_dbg_crypt() does

ret = __sev_dbg_decrypt(kvm,
__sme_page_pa(src_p[0]) + s_off,
dst_vaddr, 0,
__sme_page_pa(dst_p[0]) + d_off,
len, &argp->error);

and that 4th argument is 0. IINM, that's dst_kaddr and you're doing

memcpy((void *)dst_kaddr, page_address(tpage) + offset, size);
^^^^^^^^^^^^^^^^

BOOM!

--
Regards/Gruss,
Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

\
 
 \ /
  Last update: 2017-10-30 16:13    [W:0.832 / U:0.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site