--- 4895f0e053229bc8c04b568912340ffdbc02a076 +++ e3d4eda93ed95f915e186a2caaa7e48bf1524e6f @@ -258,9 +258,16 @@ static int hci_uart_tty_open(struct tty_ BT_DBG("tty %p", tty); + /* FIXME: This btw is bogus, nothing requires the old ldisc to clear + the pointer */ if (hu) return -EEXIST; + /* Error if the tty has no write op instead of leaving an exploitable + hole */ + if (tty->ops->write == NULL) + return -EOPNOTSUPP; + if (!(hu = kzalloc(sizeof(struct hci_uart), GFP_KERNEL))) { BT_ERR("Can't allocate control structure"); return -ENFILE;