Re: [PATCH v2] x86/sev: Fix dereference NULL return value
From: Shresth Prasad
Date: Wed Nov 20 2024 - 07:53:34 EST
On Wed, Nov 20, 2024 at 2:33 AM Borislav Petkov <bp@xxxxxxxxx> wrote:
>
> On Wed, Nov 20, 2024 at 02:21:13AM +0530, Shresth Prasad wrote:
> > Prevent a NULL pointer dereference in snp_kexec_finish() by checking the
> > value returned by lookup_address() call.
>
> Can this really happen?
lookup_address() does return NULL in some paths so I do assume that it
can happen, unless there's a logical reason why it can't (please let me know if
that's the case). I've also seen it be checked this way in a couple
other places.
>
> > This issue was reported by Coverity scan:
> > https://scan7.scan.coverity.com/#/project-view/52279/11354?selectedIssue=1601527
>
> I can't open this page - all coverity folks: you either describe what the
> issue is or don't bother sending patches.
I'm not sure why you can't open the page but would it help if I was more
descriptive in the commit message?
>
> > Fixes: 3074152e56c9 ("x86/sev: Convert shared memory back to private on kexec")
>
> So I'd hope if you report a bug against some patch, the least you could do is
> CC its author...
Really sorry about that, I completely overlooked it. I'll CC them
when I resend the patch.
Best Regards,
Shresth