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] [day] [month] [year] [list]
Message-ID: <20201229105618.GA29947@zn.tnic>
Date:   Tue, 29 Dec 2020 11:56:18 +0100
From:   Borislav Petkov <bp@...en8.de>
To:     Sean Christopherson <seanjc@...gle.com>
Cc:     Peter Gonda <pgonda@...gle.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Joerg Roedel <jroedel@...e.de>,
        Tom Lendacky <thomas.lendacky@....com>,
        linux-kernel@...r.kernel.org, x86@...nel.org,
        David Rientjes <rientjes@...gle.com>
Subject: Re: [PATCH] x86/sev-es: Fix SEV-ES OUT/IN immediate opcode vc
 handling

On Mon, Dec 28, 2020 at 03:43:06PM -0800, Sean Christopherson wrote:
> Eh, casting to u8 is "absolutely correct" as well.  I don't like using bytes[]
> because it feels like accessing the raw data as opposed to the end result of
> decoding, but it's not a sticking point.

Ok, code in the kernel uses mostly ->value so u8 casting it is.

> Yes, insn_get_immediate() sets insn->immediate.value directly and sign extends
> the imm8 (which is correct, e.g. for "AND r/m64, imm8"). 
> 
> 	switch (inat_immediate_size(insn->attr)) {
> 	case INAT_IMM_BYTE:
> 		insn->immediate.value = get_next(signed char, insn);
> 		insn->immediate.nbytes = 1;

Ah, there it is. And we set nbytes too, conveniently.

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ