serial: fixup /proc/tty/driver/serial after proc_fops conversion
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 22 lines · Linux Kernel Mailing List
serial: fixup
/proc/tty/driver/serialafterproc_fopsconversion"struct
tty_driver*" lies inm->privatenot in v which isSEQ_TOKEN_STARTwhich is 1 which is enough to trigger NULL dereference next line:BUG: unable to handle kernel NULL pointer dereference at 000000ad IP: [<c040d689>] uart_proc_show+0xe/0x2b0Noticed by Linus.
Signed-off-by Alexey Dobriyan <[email protected]>Signed-off-by Linus Torvalds <[email protected]>---
drivers/serial/serial_core.c | 2 +-1 files changed, 1 insertions(+), 1 deletions(-)drivers/serial/serial_core.c +0
-0
drivers/serial/serial_core.c static void uart_line_info(struct seq_file *m, struct uart_driver *drv, int i) · line 1770
Quoted 7 lines
drivers/serial/serial_core.c +1
-1@@ -1765,7 +1765,7 @@ static void uart_line_info(struct seq_file *m, struct uart_driver *drv, int i) static int uart_proc_show(struct seq_file *m, void *v) { - struct tty_driver *ttydrv = v; + struct tty_driver *ttydrv = m->private; struct uart_driver *drv = ttydrv->driver_state; int i;
Yeah, I've been bitten by this one in the past, too. It's very confusing to have a `void *'
parameter in a callback whose registration (proc_create_data()) also takes a `void *'.
What is this `v' parameter actually used for? I couldn't find any users during a quick
(non-exhaustive) search?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds