lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 30 Oct 2017 16:12:30 +0100
From:   Borislav Petkov <bp@...en8.de>
To:     Brijesh Singh <brijesh.singh@....com>
Cc:     kvm@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>,
        "H. Peter Anvin" <hpa@...or.com>,
        Paolo Bonzini <pbonzini@...hat.com>,
        Radim Krčmář <rkrcmar@...hat.com>,
        Joerg Roedel <joro@...tes.org>,
        Tom Lendacky <thomas.lendacky@....com>, x86@...nel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ