[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMkAt6pqBoLguQiZMXgAY3H+wUj4WE5jkWZchLWWK9Sg33BfMA@mail.gmail.com>
Date: Fri, 4 Nov 2022 19:33:23 -0600
From: Peter Gonda <pgonda@...gle.com>
To: Dionna Glaze <dionnaglaze@...gle.com>
Cc: linux-kernel@...r.kernel.org, x86@...nel.org,
Tom Lendacky <Thomas.Lendacky@....com>,
Paolo Bonzini <pbonzini@...hat.com>,
Joerg Roedel <jroedel@...e.de>,
Thomas Gleixner <tglx@...utronix.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Borislav Petkov <bp@...e.de>, Haowen Bai <baihaowen@...zu.com>,
Liam Merwick <liam.merwick@...cle.com>,
Yang Yingliang <yangyingliang@...wei.com>
Subject: Re: [PATCH v8 3/4] virt: sev-guest: Remove err in handle_guest_request
On Fri, Nov 4, 2022 at 5:01 PM Dionna Glaze <dionnaglaze@...gle.com> wrote:
>
> The err variable may not be set in the call to snp_issue_guest_request,
> yet it is unconditionally written back to fw_err if fw_err is non-null.
> This is undefined behavior, and currently returns uninitialized kernel
> stack memory to user space.
>
> The fw_err argument is better to just pass through to
> snp_issue_guest_request, so we do that by passing along the ioctl
> argument. This removes the need for an argument to handle_guest_request.
>
> Cc: Tom Lendacky <Thomas.Lendacky@....com>
> Cc: Paolo Bonzini <pbonzini@...hat.com>
> Cc: Joerg Roedel <jroedel@...e.de>
> Cc: Peter Gonda <pgonda@...gle.com>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: Dave Hansen <dave.hansen@...ux.intel.com>
> Cc: Borislav Petkov <bp@...e.de>
> Cc: Haowen Bai <baihaowen@...zu.com>
> Cc: Liam Merwick <liam.merwick@...cle.com>
> Cc: Yang Yingliang <yangyingliang@...wei.com>
>
> Fixes: fce96cf04430 ("virt: Add SEV-SNP guest driver")
> Signed-off-by: Dionna Glaze <dionnaglaze@...gle.com>
Reviewed-by: Peter Gonda <pgonda@...gle.com>
Powered by blists - more mailing lists