mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* 8250 serial issues in 2.6.0-test9
@ 2003-10-30 21:23 Bjorn Helgaas
  0 siblings, 0 replies; only message in thread
From: Bjorn Helgaas @ 2003-10-30 21:23 UTC (permalink / raw)
  To: Russell King; +Cc: linux-kernel

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)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-10-30 21:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-30 21:23 8250 serial issues in 2.6.0-test9 Bjorn Helgaas

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®