[PATCH AUTOSEL 4.14 09/30] tty: check name length in tty_find_polling_driver()

2018-11-04 Thread Sasha Levin
From: Miles Chen [ Upstream commit 33a1a7be198657c8ca26ad406c4d2a89b7162bcc ] The issue is found by a fuzzing test. If tty_find_polling_driver() recevies an incorrect input such as ',,' or '0b', the len becomes 0 and strncmp() always return 0. In this case, a null p->ops->poll_init() is called

[PATCH AUTOSEL 4.14 09/30] tty: check name length in tty_find_polling_driver()

2018-11-04 Thread Sasha Levin
From: Miles Chen [ Upstream commit 33a1a7be198657c8ca26ad406c4d2a89b7162bcc ] The issue is found by a fuzzing test. If tty_find_polling_driver() recevies an incorrect input such as ',,' or '0b', the len becomes 0 and strncmp() always return 0. In this case, a null p->ops->poll_init() is called