From: Ross Philipson <ross.philipson@oracle.com>
To: Borislav Petkov <bp@alien8.de>
Cc: linux-kernel@vger.kernel.org, x86@kernel.org,
daniel.kiper@oracle.com, dpsmith@apertussolutions.com,
tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com,
luto@amacapital.net, kanth.ghatraju@oracle.com,
trenchboot-devel@googlegroups.com
Subject: Re: [PATCH 1/2] x86/boot: Fix memremap of setup_indirect structures
Date: Thu, 24 Feb 2022 10:13:32 -0500 [thread overview]
Message-ID: <d982c172-e368-8917-679e-fc7426b58983@oracle.com> (raw)
In-Reply-To: <YheLYDdG3w6WGhSM@zn.tnic>
On 2/24/22 08:42, Borislav Petkov wrote:
> On Tue, Feb 22, 2022 at 04:01:32PM -0500, Ross Philipson wrote:
>> In the ioremap.c module, the check for NULL is only missing in the
>> functions we updated but the lack of a check was already there before
>> these changes went in.
>>
>> In the setup.c and e820.c modules, the check for NULL is missing in the
>> functions we updated but the lack of a check was already there before
>> these changes went in in those functions. The lack of early_memremap()
>> NULL checks can also be found in other functions in those modules.
>
> I don't know how to understand this statement: are you saying that,
> because there are other cases where - for whatever reason - the retval
> check is not taking place - you should not do it either?
>
> Because I can see other places where the return value is checked. I
> mean, if the return value check doesn't matter, why not make this
> function simply void and not bother at all?
Sorry if I am being vague. I will try to clarify.
In the functions I made changes to, some already checked return values
from early_memremap and some didn't prior to my changes. In addition,
there are other places/functions in those files that did not check
return values from early_memremap.
I did a search yesterday and found there are other places where the
return value from early_memremap is not checked in files I did not
touch. In general the handling of return values from early_memremap is
very inconsistent throughout arch/x86.
>
>> Fixing it in other functions and possibly elsewhere in the arch/x86 code
>> seems to be out of scope for this patch set. We could send separate
>> patches and hunt down other places this check is missing.
>
> That would be appreciated.
I will submit a follow on patch set that chases down all the places
where early_memremap return values are not checked and fix them. In
addition I will do the same for early_ioremap since it seems to have the
same issues throughout arch/x86.
Thanks
Ross
>
> Thx.
>
next prev parent reply other threads:[~2022-02-24 15:14 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-27 17:04 [PATCH 0/2] x86/boot: Fix setup_indirect support Ross Philipson
2022-01-27 17:04 ` [PATCH 1/2] x86/boot: Fix memremap of setup_indirect structures Ross Philipson
2022-02-11 17:24 ` Borislav Petkov
2022-02-15 11:34 ` Ross Philipson
2022-02-15 18:37 ` Borislav Petkov
2022-02-22 21:01 ` Ross Philipson
2022-02-24 13:42 ` Borislav Petkov
2022-02-24 15:13 ` Ross Philipson [this message]
2022-01-27 17:04 ` [PATCH 2/2] x86/boot: Add setup_indirect support in early_memremap_is_setup_data Ross Philipson
2022-02-11 18:41 ` Borislav Petkov
2022-02-15 11:36 ` Ross Philipson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d982c172-e368-8917-679e-fc7426b58983@oracle.com \
--to=ross.philipson@oracle.com \
--cc=bp@alien8.de \
--cc=daniel.kiper@oracle.com \
--cc=dpsmith@apertussolutions.com \
--cc=hpa@zytor.com \
--cc=kanth.ghatraju@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=trenchboot-devel@googlegroups.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®