All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ross Philipson <ross.philipson@oracle.com>
To: linux-kernel@vger.kernel.org, x86@kernel.org
Cc: ross.philipson@oracle.com, dpsmith@apertussolutions.com,
	tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
	hpa@zytor.com, luto@amacapital.net, dave.hansen@linux.intel.com,
	kanth.ghatraju@oracle.com, trenchboot-devel@googlegroups.com
Subject: [PATCH 0/2] x86: Check return values for early memory/IO remap calls
Date: Fri, 15 Apr 2022 11:09:59 -0400	[thread overview]
Message-ID: <1650035401-22855-1-git-send-email-ross.philipson@oracle.com> (raw)

While sending an earlier patch set it was discovered that there are a
number of places in early x86 code were the functions early_memremap()
and early_ioremap() are called but the returned pointer is not checked
for NULL. Since NULL can be returned for a couple of reasons, the return
value should be checked for NULL.

This set fixes the places where the checks were missing. It was not always
clear what the best failure mode should be when NULL is detected. In modules
where other places tended to pr_warn or panic e.g., the same was done for
the checks. In other places it was based on how significantly fatal the
failure would end up being. The review process may point out places where
this should be changed.

Ross Philipson (2):
  x86: Check return values from early_memremap calls
  x86: Check return values from early_ioremap calls

 arch/x86/kernel/apic/x2apic_uv_x.c |  2 ++
 arch/x86/kernel/devicetree.c       | 10 ++++++++++
 arch/x86/kernel/e820.c             |  5 +++++
 arch/x86/kernel/early_printk.c     |  2 ++
 arch/x86/kernel/jailhouse.c        |  6 ++++++
 arch/x86/kernel/mpparse.c          | 23 +++++++++++++++++++++++
 arch/x86/kernel/setup.c            |  5 +++++
 arch/x86/kernel/vsmp_64.c          |  3 +++
 arch/x86/xen/enlighten_hvm.c       |  2 ++
 arch/x86/xen/mmu_pv.c              |  8 ++++++++
 arch/x86/xen/setup.c               |  2 ++
 11 files changed, 68 insertions(+)

-- 
1.8.3.1


             reply	other threads:[~2022-04-15 15:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-15 15:09 Ross Philipson [this message]
2022-04-15 15:10 ` [PATCH 1/2] x86: Check return values from early_memremap calls Ross Philipson
2022-04-21  8:37   ` Thomas Gleixner
2022-10-08 15:12   ` Borislav Petkov
2022-10-10  8:46     ` Jan Kiszka
2022-10-12 15:13     ` Ross Philipson
2022-10-12 15:26       ` Juergen Gross
2022-10-12 15:53       ` Borislav Petkov
2022-04-15 15:10 ` [PATCH 2/2] x86: Check return values from early_ioremap calls 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=1650035401-22855-1-git-send-email-ross.philipson@oracle.com \
    --to=ross.philipson@oracle.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.