Re: [PATCH] tty fix oops when rmmod 8250

From
Jiri Slaby <hidden>
Date
2017-09-18 08:43:12
Also in
linux-fsdevel, lkml
Reply to
nixiaoming, 2017-09-15
On 09/15/2017, 11:45 AM, nixiaoming wrote:
After rmmod 8250.ko
tty_kref_put starts kwork (release_one_tty) to release proc interface
I believe you wanted to add a period here.
oops when accessing driver->driver_name in proc_tty_unregister_driver
"The kernel oopses when"... ?
Use jprobe, found driver->driver_name point to 8250.ko
static static struct uart_driver serial8250_reg
.driver_name= serial,

Use name in proc_dir_entry instead of driver->driver_name to fix oops

test on linux 4.1.12:
...
quoted hunk ↗ jump to hunk
@@ -164,7 +165,7 @@ void proc_tty_unregister_driver(struct tty_driver *driver)
 	if (!ent)
 		return;
 		
-	remove_proc_entry(driver->driver_name, proc_tty_driver);
+	remove_proc_entry(ent->name, proc_tty_driver);
Yes, that makes sense. Using possibly stale driver_name cannot really
work out. I only wonder why nobody noticed until now...

So, can you reproduce also on 4.13 or something newer like that?

thanks,
-- 
js
suse labs
Thread (3 messages) 3 messages, 2 authors, last reply 2017-10-11
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help