From: ebiederm@xmission.com (Eric W. Biederman)
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
<linux-kernel@vger.kernel.org>,
Alan Cox <alan@lxorguk.ukuu.org.uk>,
Russell King <rmk+lkml@arm.linux.org.uk>,
linux-serial@vger.kernel.org, Bryan Wu <cooloney@kernel.org>
Subject: Re: [PATCH] serial8250: Sanity check nr_uarts on all paths.
Date: Fri, 11 Jul 2008 13:37:14 -0700 [thread overview]
Message-ID: <m1prpkcg3p.fsf@frodo.ebiederm.org> (raw)
In-Reply-To: <m1wsjsdxr1.fsf@frodo.ebiederm.org> (Eric W. Biederman's message of "Fri, 11 Jul 2008 12:30:42 -0700")
I had 8250.nr_uarts=16 in the boot line of a test kernel and I had a
weird mysterious crash in sysfs. After an taking in depth look I realized
that CONFIG_SERIAL_8250_NR_UARTS was set to 4 and I was walking off
the end of the serial8250_ports array.
Ouch!!!
Don't let this happen to someone else.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Acked-by: Alan Cox <alan@redhat.com>
---
Alan Cox <alan@lxorguk.ukuu.org.uk> writes:
> Added to ttydev tree but please fire straight at Linus in case he fancies
> it for 2.6.26
drivers/serial/8250.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 1bc00b7..be95e55 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -2623,6 +2623,9 @@ static struct console serial8250_console = {
static int __init serial8250_console_init(void)
{
+ if (nr_uarts > UART_NR)
+ nr_uarts = UART_NR;
+
serial8250_isa_init_ports();
register_console(&serial8250_console);
return 0;
--
1.5.3.rc6.17.g1911
prev parent reply other threads:[~2008-07-11 20:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-11 19:30 [PATCH] serial8250: Sanity check nr_uarts on all paths Eric W. Biederman
2008-07-11 20:05 ` Alan Cox
2008-07-11 20:37 ` Eric W. Biederman [this message]
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=m1prpkcg3p.fsf@frodo.ebiederm.org \
--to=ebiederm@xmission.com \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=cooloney@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=rmk+lkml@arm.linux.org.uk \
--cc=torvalds@linux-foundation.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