linux/drivers/isdn/i4l
Jia-Ju Bai 2ff33d6637 isdn: i4l: isdn_tty: Fix some concurrency double-free bugs
The functions isdn_tty_tiocmset() and isdn_tty_set_termios() may be
concurrently executed.

isdn_tty_tiocmset
  isdn_tty_modem_hup
    line 719: kfree(info->dtmf_state);
    line 721: kfree(info->silence_state);
    line 723: kfree(info->adpcms);
    line 725: kfree(info->adpcmr);

isdn_tty_set_termios
  isdn_tty_modem_hup
    line 719: kfree(info->dtmf_state);
    line 721: kfree(info->silence_state);
    line 723: kfree(info->adpcms);
    line 725: kfree(info->adpcmr);

Thus, some concurrency double-free bugs may occur.

These possible bugs are found by a static tool written by myself and
my manual code review.

To fix these possible bugs, the mutex lock "modem_info_mutex" used in
isdn_tty_tiocmset() is added in isdn_tty_set_termios().

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-01-11 17:56:47 -08:00
..
isdn_audio.c
isdn_audio.h
isdn_bsdcomp.c treewide: Use array_size() in vmalloc() 2018-06-12 16:19:22 -07:00
isdn_common.c isdn: Disable IIOCDBGVAR 2018-08-16 12:26:24 -07:00
isdn_common.h
isdn_concap.c
isdn_concap.h
isdn_net.c
isdn_net.h
isdn_ppp.c
isdn_ppp.h
isdn_tty.c isdn: i4l: isdn_tty: Fix some concurrency double-free bugs 2019-01-11 17:56:47 -08:00
isdn_tty.h
isdn_ttyfax.c
isdn_ttyfax.h
isdn_v110.c isdn: mark expected switch fall-throughs 2018-07-04 22:17:32 +09:00
isdn_v110.h
isdn_x25iface.c
isdn_x25iface.h
isdnhdlc.c
Kconfig
Makefile