Merge tag 'tty-6.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 1 Oct 2023 19:44:45 +0000 (12:44 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 1 Oct 2023 19:44:45 +0000 (12:44 -0700)
Pull tty / serial driver fixes from Greg KH:
 "Here are two tty/serial driver fixes for 6.6-rc4 that resolve some
  reported regressions:

   - revert a n_gsm change that ended up causing problems

   - 8250_port fix for irq data

  both have been in linux-next for over a week with no reported
  problems"

* tag 'tty-6.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
  Revert "tty: n_gsm: fix UAF in gsm_cleanup_mux"
  serial: 8250_port: Check IRQ data before use

drivers/tty/n_gsm.c
drivers/tty/serial/8250/8250_port.c

index b3550ff..1f3aba6 100644 (file)
@@ -3097,10 +3097,8 @@ static void gsm_cleanup_mux(struct gsm_mux *gsm, bool disc)
                gsm->has_devices = false;
        }
        for (i = NUM_DLCI - 1; i >= 0; i--)
-               if (gsm->dlci[i]) {
+               if (gsm->dlci[i])
                        gsm_dlci_release(gsm->dlci[i]);
-                       gsm->dlci[i] = NULL;
-               }
        mutex_unlock(&gsm->mutex);
        /* Now wipe the queues */
        tty_ldisc_flush(gsm->tty);
index fb891b6..1416273 100644 (file)
@@ -1936,7 +1936,10 @@ int serial8250_handle_irq(struct uart_port *port, unsigned int iir)
                skip_rx = true;
 
        if (status & (UART_LSR_DR | UART_LSR_BI) && !skip_rx) {
-               if (irqd_is_wakeup_set(irq_get_irq_data(port->irq)))
+               struct irq_data *d;
+
+               d = irq_get_irq_data(port->irq);
+               if (d && irqd_is_wakeup_set(d))
                        pm_wakeup_event(tport->tty->dev, 0);
                if (!up->dma || handle_rx_dma(up, iir))
                        status = serial8250_rx_chars(up, status);