serial: 8250_fintek: Fix crash with baud rate B0
The 8250_fintek.c is support the Fintek F81866/F81216 with dynamic clock. But It'll generate "division by zero" exception and crash in fintek_8250_set_termios() with baud rate 0 on baudrate_table[i] % baud. It can be tested with following C code: ... struct termios options; tcgetattr(fd, &options); ... options.c_cflag = CS8 | CREAD; /* baud rate 0 */ tcsetattr(fd, TCSANOW, &options); tcflush(fd, TCIOFLUSH); Fixes: 195638b6 ("serial: 8250_fintek: UART dynamic clocksource on Fintek F81866") Reported-by:Lukas Redlinger <rel+kernel@agilox.net> Cc: Lukas Redlinger <rel+kernel@agilox.net> Signed-off-by:
Ji-Ze Hong (Peter Hong) <hpeter+linux_kernel@gmail.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Loading
Please register or sign in to comment