From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, Geert Uytterhoeven <geert@linux-m68k.org>,
Finn Thain <fthain@telegraphics.com.au>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>
Subject: [PATCH 3.4 05/43] TTY: pmac_zilog, check existence of ports in pmz_console_init()
Date: Mon, 6 Jan 2014 14:39:22 -0800 [thread overview]
Message-ID: <20140106223942.412026164@linuxfoundation.org> (raw)
In-Reply-To: <20140106223942.259651490@linuxfoundation.org>
3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <geert@linux-m68k.org>
commit dc1dc2f8a5dd863bf2e79f338fc3ae29e99c683a upstream.
When booting a multi-platform m68k kernel on a non-Mac with "console=ttyS0"
on the kernel command line, it crashes with:
Unable to handle kernel NULL pointer dereference at virtual address (null)
Oops: 00000000
PC: [<0013ad28>] __pmz_startup+0x32/0x2a0
...
Call Trace: [<002c5d3e>] pmz_console_setup+0x64/0xe4
The normal tty driver doesn't crash, because init_pmz() checks
pmz_ports_count again after calling pmz_probe().
In the serial console initialization path, pmz_console_init() doesn't do
this, causing the driver to crash later.
Add a check for pmz_ports_count to fix this.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Finn Thain <fthain@telegraphics.com.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/tty/serial/pmac_zilog.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/tty/serial/pmac_zilog.c
+++ b/drivers/tty/serial/pmac_zilog.c
@@ -2051,6 +2051,9 @@ static int __init pmz_console_init(void)
/* Probe ports */
pmz_probe();
+ if (pmz_ports_count == 0)
+ return -ENODEV;
+
/* TODO: Autoprobe console based on OF */
/* pmz_console.index = i; */
register_console(&pmz_console);
next prev parent reply other threads:[~2014-01-06 22:39 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-06 22:39 [PATCH 3.4 00/43] 3.4.76-stable review Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 01/43] USB: serial: fix race in generic write Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 02/43] ceph: cleanup aborted requests when re-sending requests Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 03/43] ceph: wake up safe waiters when unregistering request Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 04/43] powerpc: kvm: fix rare but potential deadlock scene Greg Kroah-Hartman
2014-01-06 22:39 ` Greg Kroah-Hartman [this message]
2014-01-06 22:39 ` [PATCH 3.4 06/43] ASoC: wm8904: fix DSP mode B configuration Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 07/43] ALSA: Add SNDRV_PCM_STATE_PAUSED case in wait_for_avail function Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 09/43] selinux: fix broken peer recv check Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 10/43] selinux: selinux_setprocattr()->ptrace_parent() needs rcu_read_lock() Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 11/43] ftrace: Initialize the ftrace profiler for each possible cpu Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 12/43] intel_idle: initial IVB support Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 13/43] intel_idle: enable IVB Xeon support Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 14/43] ext4: fix use-after-free in ext4_mb_new_blocks Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 16/43] sched/rt: Fix rqs cpupri leak while enqueue/dequeue child RT entities Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 18/43] net_dma: mark broken Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 19/43] drm/radeon: fix asic gfx values for scrapper asics Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 20/43] drm/radeon: 0x9649 is SUMO2 not SUMO Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 21/43] ceph: Avoid data inconsistency due to d-cache aliasing in readpage() Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 22/43] tg3: Expand 4g_overflow_test workaround to skb fragments of any size Greg Kroah-Hartman
2014-01-06 22:58 ` Eric Dumazet
2014-01-06 23:05 ` Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 23/43] dm9601: fix reception of full size ethernet frames on dm9620/dm9621a Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 24/43] dm9601: work around tx fifo sync issue on dm962x Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 25/43] ath9k: Fix interrupt handling for the AR9002 family Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 26/43] ath9k_htc: properly set MAC address and BSSID mask Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 27/43] powerpc: Fix bad stack check in exception entry Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 28/43] powerpc: Align p_end Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 29/43] cpupower: Fix segfault due to incorrect getopt_long arugments Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 30/43] libata: add ATA_HORKAGE_BROKEN_FPDMA_AA quirk for Seagate Momentus SpinPoint M8 Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 31/43] radiotap: fix bitmap-end-finding buffer overrun Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 32/43] rtlwifi: pci: Fix oops on driver unload Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 33/43] mm/hugetlb: check for pte NULL pointer in __page_check_address() Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 34/43] Input: allocate absinfo data when setting ABS capability Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 35/43] GFS2: dont hold s_umount over blkdev_put Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 36/43] GFS2: Fix incorrect invalidation for DIO/buffered I/O Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 37/43] jbd2: dont BUG but return ENOSPC if a handle runs out of space Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 38/43] gpio: msm: Fix irq mask/unmask by writing bits instead of numbers Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 39/43] sched: Avoid throttle_cfs_rq() racing with period_timer stopping Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 40/43] sh: always link in helper functions extracted from libgcc Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 41/43] selinux: look for IPsec labels on both inbound and outbound packets Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 42/43] selinux: process labeled IPsec TCP SYN-ACK packets properly in selinux_ip_postroute() Greg Kroah-Hartman
2014-01-06 22:40 ` [PATCH 3.4 43/43] hwmon: (w83l768ng) Fix fan speed control range Greg Kroah-Hartman
2014-01-07 5:01 ` [PATCH 3.4 00/43] 3.4.76-stable review Guenter Roeck
2014-01-07 15:22 ` Greg Kroah-Hartman
2014-01-07 19:09 ` Shuah Khan
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=20140106223942.412026164@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=benh@kernel.crashing.org \
--cc=fthain@telegraphics.com.au \
--cc=geert@linux-m68k.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.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;
as well as URLs for NNTP newsgroup(s).