mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: Russell King <rmk@arm.linux.org.uk>
Cc: linux-kernel@vger.kernel.org
Subject: 8250 serial issues in 2.6.0-test9
Date: Thu, 30 Oct 2003 14:23:47 -0700	[thread overview]
Message-ID: <200310301423.47442.bjorn.helgaas@hp.com> (raw)

Hi Russell,

I know you don't want to mess with the setserial problem I
tripped over, and that's fine -- it's not a huge issue for
me.  While poking around at it, I noticed a couple other
issues, which I'll just mention here in case anybody else
wants to have a go at reworking this code.

Mostly this mail is just because I'm about to go on vacation,
and didn't want all my pondering to be completely wasted :-)

Bjorn


serial8250_release_port():
	When releasing an RSA port, it looks like serial8250_release_port()
	releases the wrong range ("start + offset" rather than "start") 
	for the standard IO port region.

serial8250_request_port():
	The error path ("ret < 0") leaks memory because request_region()
	kmallocs the new resource, but release_resource() doesn't free it.

serial8250_config_port():
	Same leak as in serial8250_request_port().

serial8250_release_port()/serial8250_request_port():
	The problem I mentioned before -- _request_port() doesn't
	ioremap the region that was iounmapped by _release_port(),
	so "setserial /dev/ttyS0 port 0x3f8" causes an oops if
	ttyS0 is an MMIO uart:

	    uart_set_info()
	        serial8250_release_port()
	            iounmap(membase);
	            membase = NULL;
	            release_mem_region(mapbase, ...);
	        serial8250_request_port()
	            request_mem_region(mapbase, ...);
	        serial8250_startup()
	            serial_out()
	                port.iotype == IO_MEM, so
	                    writeb(value, membase);
	                        oops - null pointer dereference (membase == NULL)


                 reply	other threads:[~2003-10-30 21:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200310301423.47442.bjorn.helgaas@hp.com \
    --to=bjorn.helgaas@hp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk@arm.linux.org.uk \
    /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®